From 000905257ea63374c3bffc52dc285f732910f99f Mon Sep 17 00:00:00 2001 From: sudoer777 <78781902+sudoer777@users.noreply.github.com> Date: Fri, 26 Nov 2021 14:09:00 -0700 Subject: [PATCH] Improve division page validity check --- public/scripts/manage/division.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/scripts/manage/division.js b/public/scripts/manage/division.js index fb623c5..a542a65 100644 --- a/public/scripts/manage/division.js +++ b/public/scripts/manage/division.js @@ -48,6 +48,11 @@ async function checkDataValidity() { 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; else submitButton.disabled = true;