1

How develop function for password and confirmpassword in jquery,i want when i create confirm password, there is message show's "password and confirmpassword incorrect !" until the password and confirmpassword are the same and tnak's

adem
  • 31
  • 1
  • 1
  • 8

1 Answers1

1

If you need a function to validate password, try this:

jQuery(document).ready(function($) {
    function validate_password(){
        var password = $('#password_field_id').val();
        var confirm_password = $('#confirm_password_field_id').val();
        if(password === confirm_password){
            //Do something if password matches
        }
        else{
            // alert something saying password don't match
        }
    }
});
elki42
  • 123
  • 1
  • 10
melvin
  • 2,571
  • 1
  • 14
  • 37