jQuery Confirm Password Validation
jQuery Confirm Password Validation
OK, so you have created that fancy registration form and now you want to add a validation where password and confirm password fields match. You add the JQuery validate JS and then you realize that there is no inbuilt function for confirm password in the JQuery validate framework 🙂
Follow the steps mentioned below and you can get this working.
$.validator.addMethod('c_password', function(value){
if(value == $('#password').val()){
return true;
}
return false;
}, "Password and confirm password fields do not match");