function check password(password)
{
if (! password.matches([A-Z]{2}))
{
alert("You must have at least 2 capital letters in your password);
}
else if (! password.matches([0-9]{2}))
{
alert("You must have at least 2 numbers in your password);
}
else if (! password.matches([*$%@]{2}))
{
alert("You must have at least 2 of *,$,% or @ characters in your password); }
}
} What this allows you to do is to reply back with specific message that will tell the password creator how to alter the new password. In addition, we have reduced to the complexity of the regexs down to some very simple verifications.
No comments:
Post a Comment