This time I will share jQuery Plugin and tutorial about Check If Passwords Meet Complexity Requirements – password.js, hope it will help you in programming stack.
A password strength meter plugin that checks whether the password you typed meets the complexity requirements and displays a summary in the Bootstrap popover component while typing.
See Also:
How to use it:
1. Load the necessary jQuery library and Bootstrap framework in the document.
1 |
< link rel = "stylesheet" href = "/path/to/cdn/bootstrap.min.css" /> |
2 |
< script src = "/path/to/cdn/jquery.slim.min.js" ></ script > |
3 |
< script src = "/path/to/cdn/bootstrap.bundle.min.js" ></ script > |
2. Load the main script password.js
after jQuery.
1 |
< script src = "password.js" ></ script > |
3. Enable the password strength validator by adding the password_input
ID to your password field. That’s it.
1 |
< input id = "password_input" type = "password" data-html = "true" class = "form-control" /> |
4. Optionally, you can create a button to toggle the visibility of the password.
1 |
< button id = "show_password" >Toggle Password</ button > |
5. Customize the password strength meter by overriding the following options.
02 |
const passInput = document.getElementById( 'password_input' ); |
05 |
const hideCompleted = false |
08 |
const showPasswordButton = true |