Javascript Regex for Password Requirements
Posted: Mon Oct 04, 2004 11:01 pm
Hey, I need a Javascript function to be executed when a form is submitted to make sure the password matches the password requirements for my site.
The requirements are (Same as Windows Server 2003 AD):
At least 8 Chars in Length,
3 of the 4 conditions met:
Uppercase, Lowercase, Number, Special Chars.
I tried to get myself started, but I am dumb.
The requirements are (Same as Windows Server 2003 AD):
At least 8 Chars in Length,
3 of the 4 conditions met:
Uppercase, Lowercase, Number, Special Chars.
I tried to get myself started, but I am dumb.
Code: Select all
function cpr() {
var regex=/^A-Za-z0-9$/g;
inputstr = document.regform.password1.value;
if (!regex.test(inputstr)) {
alert('Your Password Does Not Contain Upper or Lower or a Number');
}
}