Improve division page validity check

main
sudoer777 2021-11-26 14:09:00 -07:00
parent 644c8fdec3
commit 000905257e
1 changed files with 5 additions and 0 deletions

View File

@ -48,6 +48,11 @@ async function checkDataValidity() {
if(!nameTextbox.value) dataIsValid = false; if(!nameTextbox.value) dataIsValid = false;
const sportHasContent = sportDropdown.options.length;
const genderHasContent = genderDropdown.options.length;
if(!sportHasContent || !genderHasContent) dataIsValid = false;
if(dataIsValid) submitButton.disabled = false; if(dataIsValid) submitButton.disabled = false;
else submitButton.disabled = true; else submitButton.disabled = true;