// just for the demos, avoids form submit jQuery.validator.setDefaults({ debug: true, success: "valid"}); $( "#myform" ).validate({ rules: { password: "required", password_again: { equalTo: "#password" } }}); (#)
Jquery Plugin Password Validation
# jQuery Password Validation (Password Validation)
The jQuery Password Validation (Password Validation) plugin extends the jQuery Validate plugin and provides two components:
A function that evaluates relevant factors of 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 method for the validation plugin 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 message display, and integrate it into existing forms.
The current version of this plugin is 1.0.0.
## Usage
To use the Password Validation (Password Validation) plugin, please add a class "password" to the input, and also add the basic markup for displaying the strength where it is needed 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. Or override $.validator.passwordRating.messages to provide other messages, such as localization.
## Live Demo
Makes "field" required to be the same as #other
// just for the demos, avoids form submit jQuery.validator.setDefaults({ debug: true, success: "valid"}); $( "#myform" ).validate({ rules: { password: "required", password_again: { equalTo: "#password" } }}); (#)
// just for the demos, avoids form submit jQuery.validator.setDefaults({ debug: true, success: "valid"}); $( "#myform" ).validate({ rules: { password: "required", password_again: { equalTo: "#password" } }}); (#)
YouTip