Hi,
I've looked online for a few days but haven't been able to find an adequate solution.
I'm just trying to use javascript to validate that a password doesn't contain user data (first name, last name, etc...)
I really thought it would be simple. Here is what I'm using:
function validate_fname(field,alerttxt)
{
with (field)
{
re = /form.firstName.value/;
if(re.test(value))
{alert(alerttxt);return false}
else {return true}
}
}
function validate_form(thisform)
{
with (thisform)
{
if (validate_fname(password,'Password must not contain users first name')==false)
{password.focus();return false}
}
}
All the other validation I have on the page works (length, special chars, lower & upper case) but I can't seem to get it to check if the password contains their first name.
I have seen many pages that mention this being a good practice, but not how to implement it. I have been stuck on this one for weeks and I'm just clueless what else to do.
Thanks for any help you can provide.
Danny