Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery Password Validation

jQuery Password Validation

The jQuery Password Validation plugin extends the jQuery Validate plugin, providing two components:
A function that evaluates factors related to a password: such as the mix of uppercase and lowercase letters, the mix of characters (numbers, special characters), length, and similarity to the username (optional).
A custom validation method that uses the evaluation function to display password strength. The displayed text can be localized.

You can easily customize the appearance of the strength display, localize the messages, and integrate it into existing forms.

The current version of this plugin is 1.0.0.

Usage

To use the Password Validation plugin, add a class "password" to the input, and add the basic markup for displaying strength wherever you want it shown in the form:



              
        
        
            
        
    

Apply the Validate plugin to the form:



$(document).ready(function() {

  $("#register").validate();

});

You can override $.validator.passwordRating to implement a different evaluation method. Alternatively, override $.validator.passwordRating.messages to provide other messages, such as localized ones.

Example Demonstration











Makes "field" required to be the same as #other