From 459b1a4a1ab2828083af3ac9fdfff5ca50acc0cf Mon Sep 17 00:00:00 2001 From: sudoer777 <78781902+sudoer777@users.noreply.github.com> Date: Fri, 26 Nov 2021 14:10:09 -0700 Subject: [PATCH] Improve add team page validity check --- public/scripts/manage/team.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/scripts/manage/team.js b/public/scripts/manage/team.js index 10cd386..4bc643e 100644 --- a/public/scripts/manage/team.js +++ b/public/scripts/manage/team.js @@ -39,9 +39,10 @@ async function checkDataValidity() { if(!nameTextbox.value) dataIsValid = false; + const sportHasContent = sportDropdown.options.length; + if(!sportHasContent) dataIsValid = false; - if(dataIsValid) submitButton.disabled = false; - else submitButton.disabled = true; + submitButton.disabled = !dataIsValid; } Form.addRemoveFunction(deleteButton, submissionForm, "team"); \ No newline at end of file