Top

Basic Password Strength Test (Length)


Javascript Code
+ 0 likes
Please Register to submit score.
Average Score  6.0
Scores Submitted  2
Date Added  Jul 06, 2008
Last Updated  Jul 12, 2008
Tags  dhtml  javascript  password  strength  test  type  update 
  Bookmark and Share

Introduction

Live Demo!

This password strength test will display "Weak/Moderate-Weak/Moderate/Strong" it also displays a bar showing the strength.

The important thing about this Javascript, is that it displays the message as you type rather than after you hit a "Submit" button thanks to DHTML.

Copy and paste the entire HTML from below so that you get a feel for how it works, there are also edit notes in there for if you wish to use the snippet but without this HTML.

The actual script you may want to use is between the <script type="text/javascript"></script> tags. It is the 'function passwordstrength' area.

Grab the Code

Comments

  (10)  RSS
vaseline28
Comments: 154
 
Javascript Snippet:  Basic Password Strength Test (Length)
Posted on Jul 6, 2008 2:12 am
I'm uploading a live demo of this now, obviously the above (and the demo) have no fancy effects as you would of course need to make yours have if using this...

Live Demo
EL
Comments: 1,369
 
Javascript Snippet:  Basic Password Strength Test (Length)
Posted on Jul 6, 2008 3:17 am
Nice like the live demo gives those of us that dont code JavaScript a taste of it and maybe even entice us in wanting to learn a bit thanks.`-.-ยด
F*U*R*B*Y*
Comments: 569
 
Javascript Snippet:  Basic Password Strength Test (Length)
Posted on Jul 6, 2008 3:44 am
Nice, but i cleared it all, click out and it still kept it as strong, there wasn't anything in it even ;)
vaseline28
Comments: 154
 
Javascript Snippet:  Basic Password Strength Test (Length)
Posted on Jul 6, 2008 5:01 am
Thanks EL, I only started myself earlier this week.
@F^U^R^B^Y^: How did you clear it out? With backspace?

It's easily fixed, I just need to change the event, and to know what to change
onkeypress
to, I need to know what you did!
F*U*R*B*Y*
Comments: 569
 
Javascript Snippet:  Basic Password Strength Test (Length)
Posted on Jul 6, 2008 5:47 am
onblur="FunctionToChangeToWeak('hello')"

add that to your input field....
Hawkee
Comments: 566
 
Javascript Snippet:  Basic Password Strength Test (Length)
Posted on Jul 6, 2008 10:48 am
Your criteria isn't very good. You should consider whether the password is a word, has numbers, etc. A good password isn't just long, but should also contain a few numbers and shouldn't be in the dictionary.
vaseline28
Comments: 154
 
Javascript Snippet:  Basic Password Strength Test (Length)
Posted on Jul 6, 2008 12:03 pm
Numbers, I'll try adding that in...
jonesy44
Comments: 1,072
 
Javascript Snippet:  Basic Password Strength Test (Length)
Posted on Jul 6, 2008 12:48 pm
Great work Vaseline!

For someone who knows only the basics of JS (me) this is really helpful! To know all the getelementbyID etc.. this is an awesome example!

Thanks for uploading; keep em coming !
mountaindew
Comments: 1,640
 
Javascript Snippet:  Basic Password Strength Test (Length)
Posted on Jul 7, 2008 10:51 am
Yea, include numbers and capitalization.
vaseline28
Comments: 154
 
Javascript Snippet:  Basic Password Strength Test (Length)
Posted on Jul 12, 2008 11:45 am
@Hawkee/mountaindew:
Advanced Version << Contains your 'Better Criteria'. Length/Numbers/Capitalization
Thanks for the suggestion(s).

@Anyone else: If you're not confident with Javascript/HTML I recommend that you stick to this one though.

Please Register or Login to start posting comments.
Bottom