I am using javascript for password validation:
$.validator.addMethod('mypassword', function(value, element) {
return this.optional(element) || (value.match(/^(?=.*\d)(?=.*[A-Z])[0-9a-zA-Z]{8,}$/));
},
'Password must contain at least one numeric and one uppercase alphabetic character.');
I need the password to be at least one numeric and one uppercase alphabetic character. But, if i enter the characters such as @, # ,$
with one numeric and one uppercase alphaberic character in password, it still shows the error message.
Password9 accepted
Password@1 not accepted