jQuery Password Validation (password authentication)
jQuery Password Validation (password authentication) plug-ins extend the jQuery Validate plugin provides two components:
For evaluating relevant factors password function: for example, the mix of uppercase and lowercase letters, characters (numbers, special characters) mixed, the length, and the similarity of the user name (optional).
A method of using the evaluation function password strength authentication plug-in display custom methods. Text display can be localized.
You can easily customize the appearance of the display intensity, localized sources, and integrated into the existing form.
The plug-in version is currently 1.0.0.
Use
To use the Password Validation (password authentication) plug-in, add a class "password" to input, while adding local basic mark is displayed in the form of strength to be displayed:
<form id="register"> <label for="password">Password:</label> <input class="password" name="password" id="password" /> <div class="password-meter"> <div class="password-meter-message"> </div> <div class="password-meter-bg"> <div class="password-meter-bar"></div> </div> </div> </form>
Validate the form of plug-in applications:
$(document).ready(function() { $("#register").validate(); });
You can override the $ .validator.passwordRating implement different evaluation methods. Or overloaded $ .validator.passwordRating.messages to provide additional messages, such as localized.
Examples Demo
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Makes "field" required to be the same as #other</title> <link rel="stylesheet" href="http://jqueryvalidation.org/files/demo/site-demos.css"> </head> <body> <form id="myform"> <label for="password">Password</label> <input id="password" name="password" /> <br/> <label for="password_again">Again</label> <input class="left" id="password_again" name="password_again" /> <br> <input type="submit" value="Validate!"> </form> <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="http://jqueryvalidation.org/files/dist/jquery.validate.min.js"></script> <script src="http://jqueryvalidation.org/files/dist/additional-methods.min.js"></script> <script> // just for the demos, avoids form submit jQuery.validator.setDefaults({ debug: true, success: "valid" }); $( "#myform" ).validate({ rules: { password: "required", password_again: { equalTo: "#password" } } }); </script> </body> </html>