I need to validate for a strong password with the following requirements:
1. Must be at least 8 characters in length (127 characters max)
2. Must contain at least three (3) of the four (4) following types of characters:
a. Uppercase letters
b. Lowercase letters
d. Special characters (such as _ # @ $ ^ * etc.)
3. Must not be the same as any of the previous three passwords used
Are there any suggestion?
This is my JSP function, but still cannot use.. cause the special characters have to be put in the end of password value.
var Password = document.all.new_password1.value;
var Password2 = document.all.new_password2.value;
var minLength = 8;
var re = /^\w*(?=\w*[~,!,@,#,$,%,^,&,*,(,),-,_,=,+,|,\,-,_,+,=,,,.,;,",',?,/,:,[,])(?=\w*\d)(?=\w*[a-z])(?=\w*[A-Z])\w*/;
alert("Password have to be 8 characters!");
if (Password != Password2)
alert("Password doesn't match!");