diff --git a/src/js/signup.js b/src/js/signup.js index 2c8140a..d7dcc8a 100644 --- a/src/js/signup.js +++ b/src/js/signup.js @@ -5,7 +5,11 @@ var signupBlock = document.getElementById("signedup"); var BASE_URL = "https://api.susi.ai"; var passwordlim = document.getElementById("passwordlim"); var password = document.getElementById("password"); +var cpassword = document.getElementById("cpassword"); +var emailLim=document.getElementById("emailLim") +var email=document.getElementById("email") +var cpasswordlim=document.getElementById("cpasswordlim") window.onload = () => { showsignupBlock(true); }; @@ -21,23 +25,39 @@ let showsignupBlock = (show) => { } }; + + password.addEventListener("keyup", ()=>{ if(password.value.length<6 || password.value.length>64){ passwordlim.removeAttribute("hidden"); document.getElementById("signupbutton").setAttribute("disabled", "true"); } else { passwordlim.setAttribute("hidden", "true"); + //document.getElementById("signupbutton").removeAttribute("disabled"); + } +}); + + +cpassword.addEventListener("keyup", ()=>{ + if(password.value!==cpassword.value || cpassword.value.length<6 || cpassword.value.length>64){ + cpasswordlim.removeAttribute("hidden"); + cpasswordlim.innerHTML="Either Password not match Or Password length between 6 to 64" + document.getElementById("signupbutton").setAttribute("disabled", "true"); + }else{ + cpasswordlim.setAttribute("hidden", "true"); document.getElementById("signupbutton").removeAttribute("disabled"); } }); + signupForm.addEventListener("submit", (event) => { event.preventDefault(); var email=document.getElementById("email").value; if(!email){ - alert("Email field cannot be empty"); - return; - } + //alert("Enter the proper email") + emailLim.removeAttribute("hidden"); + return; + } var password=document.getElementById("password").value; if(!password){ alert("Password field cannot be empty"); diff --git a/src/signup.html b/src/signup.html index f05107e..b7f56a1 100644 --- a/src/signup.html +++ b/src/signup.html @@ -2,6 +2,8 @@ SUSI Login Portal + + @@ -16,8 +18,11 @@
- + +
+ +

@@ -31,13 +36,18 @@
+
+ +


- Already Registered? Want to Login -

+ Already Registered? Want to Login
+