Skip to content

Commit 1370358

Browse files
committed
okaaay
1 parent 54aff9c commit 1370358

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

u/signup.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,14 @@
6464
}
6565

6666
if (!/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$/.test(password)) {
67-
statusElement.textContent = "Password doesn't meet requirements!";
67+
problms = [];
68+
if (password.length < 8) problms.push("Password must be at least 8 characters long.");
69+
if (!/^(?=.*[a-z])$/.test(password)) problms.push("Password must contain a lowercase letter.");
70+
if (!/^(?=.*[A-Z])$/.test(password)) problms.push("Password must contain an UPPERCASE letter.");
71+
if (!/^(?=.*\d)$/.test(password)) problms.push("Password must contain a numb3r.");
72+
73+
statusElement.textContent = "Password doesn't meet requirements!<br>"+problms.join("<br>");
74+
6875
document.getElementById("password").style.borderColor = "red";
6976
return;
7077
}

0 commit comments

Comments
 (0)