Improve add team page validity check

main
sudoer777 2021-11-26 14:10:09 -07:00
parent 000905257e
commit 459b1a4a1a
1 changed files with 3 additions and 2 deletions

View File

@ -39,9 +39,10 @@ async function checkDataValidity() {
if(!nameTextbox.value) dataIsValid = false; if(!nameTextbox.value) dataIsValid = false;
const sportHasContent = sportDropdown.options.length;
if(!sportHasContent) dataIsValid = false;
if(dataIsValid) submitButton.disabled = false; submitButton.disabled = !dataIsValid;
else submitButton.disabled = true;
} }
Form.addRemoveFunction(deleteButton, submissionForm, "team"); Form.addRemoveFunction(deleteButton, submissionForm, "team");