jquery password strength checker

How we can create a password validation program using JavaScript or any JS library? Solution: See this jQuery Password Strength Checker With Bootstrap, Password Validation Program.

Previously I have shared an email validation program using JavaScript, but this program is for validating password. Basically, the password validation program uses almost top websites for telling to users for choosing a strong password. If we put a weak and predictable password then anyone can guess and also have a chance of hacking.

Today you will learn to create a Password Validation program using JavaScript. Basically, there are two password input fields one for password and other for retyping the password. Middle of these two fields there is some validations. When you will choose a password according to these conditions then these conditions will be checked with a tick mark.

So, Today I am sharing jQuery Password Strength Checker With Bootstrap Layout. For creating this program I have used bootstrap for an attractive and responsive layout with less work. And for the strength checker function, I have used jQuery which is a JavaScript library. If we use pure JavaScript then code will difficult to understand and more lines.

If you are thinking now how this password checker actually is, then see the preview given below.

Preview Of Password Validation Program

See this video preview to getting an idea of how this password checker program lools like.

Live Demo

Now you can see this visually, you also can see it live by pressing the button given above. If you like this, then get the source code of its.

You May Also Like:

jQuery Password Strength Checker Source Code

Before sharing source code, let’s talk about it. First I have created a main div inside that, I have placed two password input fields and a list. I have created form-group (info) for managing all the elements and put many class names which are powered by bootstrap. And I have used two icons for checking validation, which icons are placed using font-awesome.

Now using CSS I have done little works like icon color, background color, etc. All the design and placement completely based on Bootstrap grids. In the HTML file, I have linked all the external files like Bootstrap, jQuery, Font-Awesome, etc. There is a cross icon and a tick icon, when validation is done then the cross icon becomes a tick icon.

jQuery handling the main feature of the program. JS checking the conditions using if-else statement and used password.match() command. According to action jQuery changing the CSS values and icon dynamically. Left all other things you will understand after getting the codes, I can’t explain all in writing but I have left comments in JS code.

For creating this program you have to create 3 files. First for HTML, second for CSS, and third for JavaScript. Follow the steps to creating this without any error.

index.html

Create an HTML file named ‘index.html‘ and put these codes given below.

style.css

Now create a CSS file named ‘style.css‘ and put these codes given here.

function.js

The final step, Create a JavaScript file named ‘function.js‘ and put the codes.

That’s It. Now you have successfully created jQuery Password Strength Checker With Bootstrap, Password Validation Program. If you have doubt or question comment down below.

Thanks For Visiting, Keep Visiting.

10 COMMENTS

  1. Sir which photo editor do you use to create your awesome thumbnails. Sir please tell me. Is it Photoshop or anything else?

  2. Sir thanks for sharing this but I don’t know where you got the #signup from function.js file. See the code
    $(‘#password’).keyup(function() {
    var password = $(‘#password’).val();
    if (checkStrength(password) == false) {
    $(‘#sign-up’).attr(‘disabled’, true);
    }

    • sorry, There was a sing up button I have removed that. And the condition was when validations are not complete then the signup button disabled.

      • Ok sir, I recoded everything with bootstrap 4.3.1 because that was what my site was built upon and everything worked except the appearance and disappearance of enter your password and password didn’t match. But if I code it separately with bootstrap 3 everything will be ok. Please any help will be accepted. Thanks in anticipation of positive response from you.

  3. Sir you had done 2 little mistakes in the code out there. First mistake is that you have written the spelling of Weak wrong it is “Weak” and not “Week” and the second mistake is that when our password is strong it shall have shown “Strong” but it shows “Strength”. So, please fix these 2 mistakes. Thanks!

LEAVE A REPLY

Please enter your comment!
Please enter your name here