I want it to check if the user entered the correct format for the password (which is at least one lowercase, one uppercase, one number, eight or more characters, and one special character) but I couldn't get it to validate.
JS:
var Pass = document.getElementById('password');
function validatePassword() {
if (Pass.value.match(/^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{8,}$/)) {
document.getElementById('pass').innerHTML =
'Invalid password. Please follow the format.';
return false;
}
}