From 389cfaefd5a8d2ca61538df123b45f673739b965 Mon Sep 17 00:00:00 2001
From: Krish Moodbidri <krish94@uab.edu>
Date: Thu, 18 Nov 2021 15:22:18 -0600
Subject: [PATCH] 1. improved submit button toggle case wrt checkbox value 2.
 send checkbox value instead of a hardcoded value

---
 app/static/scripts/function.js | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/app/static/scripts/function.js b/app/static/scripts/function.js
index 45f61e8..77bd28a 100644
--- a/app/static/scripts/function.js
+++ b/app/static/scripts/function.js
@@ -1,8 +1,7 @@
-var check_counter =0;
 function check() { 
   var submitButton = document.getElementById("submit");
-  if ((check_counter+=1)%2) submitButton.disabled = false;
-  else submitButton.disabled = true;
+  let ckbox = document.getElementById('agree');
+  submitButton.disabled = !ckbox.checked;
 };
 
 function displayloading1() {
@@ -20,7 +19,7 @@ function request_account() {
         email: document.getElementById("email").value,
         reason: document.getElementById("reason").value,
         username: document.getElementById("username").value,
-        aup: 1
+        aup: document.getElementById("agree").checked
     })
 }
 
-- 
GitLab