diff --git a/signin.html b/signin.html index 0e977d47..99657cec 100644 --- a/signin.html +++ b/signin.html @@ -20,17 +20,16 @@ - +
- +

Welcome to SkillWise

Sign in to access your learning dashboard

- +
- {% csrf_token %}
@@ -53,7 +52,7 @@

Welcome to SkillWise

Use special characters and numbers for a strong password

--> - + @@ -67,28 +66,28 @@

Welcome to SkillWise

const passwordInput = document.querySelector("#password"); const submitBtn = document.querySelector("#submit"); const emailInput = document.querySelector("#email"); - + togglePassword.addEventListener("click", function () { const type = passwordInput.getAttribute("type") === "password" ? "text" : "password"; passwordInput.setAttribute("type", type); - + this.classList.toggle("fa-eye-slash"); this.classList.toggle("fa-eye"); }); - - - + + + submitBtn.addEventListener("click", (e) => { e.preventDefault(); - + const email = emailInput.value; const emailError = document.getElementById("emailError"); - - + + const emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/; - + if (!emailPattern.test(email)) { - + if (!emailError) { const errorMsg = document.createElement("p"); errorMsg.id = "emailError"; @@ -97,17 +96,17 @@

Welcome to SkillWise

emailInput.parentElement.appendChild(errorMsg); } } else { - + if (emailError) { emailError.remove(); } - + e.target.closest("form").submit(); } }); - +