I have a javascript code whch validates only integers of a password. All I want is to develop the code for "var exp", which the password must be a combination of uppercase characters, lowercase characters, numeric characters and a special character.
HTML codes are working perfectly..
//Empty Validation//
function isEmpty(elemValue, field) {
if (elemValue == "" || elemValue == null) {
alert(field + " must not be empty!");
return true;
} else {
return false;
}
}
//empty validation end//
//password validation//
function pwValidation(elemValue) {
if (!isEmpty(elemValue, "Password")) {
if (elemValue.length >= 8) {
var exp1 = /^[0-9]+$/;
if (elemValue.match(exp1)) {
return true;
} else {
alert("Password must contain Upper, lower case, number and at least a special character");
return false;
}
} else {
alert("Password must at least 8 characters!");
}
} else {
return false;
}
}
//password validation end//