Today Themes Refinery teaches you how to apply jQuery password validation.

Many type of registration form on different websites. Registration process forms requires a password and it is very important the confirmation of password fields. Here we learn how to validate password and confirm password fields with jQuery. When we apply jQuery password validation we can do easily verify registration form password fields.This tutorial is about the jQuery Password Validation checking which determines the easy way to show the strength of user password on the registration forms.


You May Also Like:


Below codes validates your Password and Conform Password field. It display the error message if values are not identical. You can download (jquery.validate.js) Jquery Validation Plugin from Official website of Jquery.

<html>
 <head>
  <title> Password and Confirm Password Validation Using Jquery </title>
  <script type="text/javascript" src="http://www.technicalkeeda.com/js/javascripts/plugin/jquery.js"></script>
  <script type="text/javascript" src="http://www.technicalkeeda.com/js/javascripts/plugin/jquery.validate.js"></script>
 <script>

function validatePassword(){ 
 var validator = $("#loginForm").validate({
  rules: {                   
   password :"required",
   confirmpassword:{
    equalTo: "#password"
      }  
     },                             
     messages: {
      password :" Enter Password",
      confirmpassword :" Enter Confirm Password Same as Password"
     }
 });
 if(validator.form()){
  alert('Sucess');
 }
}

 </script>
 </head>

 <body>
 <form method="post" id="loginForm" name="loginForm">
  <table cellpadding="0" border="1">
   <tr>
    <td>Password</td>
    <td><input tabindex="1" size="40" type="password" name="password" id="password"/></td>
   </tr>
   <tr>
    <td>Confirm Password</td>
    <td><input tabindex="1" size="40" type="password" name="confirmpassword" id="confirmpassword"/></td>
   </tr>
   <tr>
    <td colspan="2" align="center"><input tabindex="3" type="button" value="Submit" onClick="validatePassword();"/></td>     
   </tr>
  </table>    
 </form> 
 </body>
</html>

About The Author

Related Posts

Leave a Reply

Your email address will not be published.