clonmelog
asked on
Checking password strength error
Hi,
Im using a script that i found at http://www.geekwisdom.com/dyn/passwdmeter to check passwords and how strong they are against the specified rules. Im currently trying to implement it here: http://www.templateit.net/register.php but im getting errors when i try to do it. I cant spot why the error is occuring because it works fine for me on a plain html form and ive just copied over the same code. any ideas?
heres the form code, the js file is available from the above link.
<script type="text/javascript" src="javascript/passwordme ter.js"></ script>
<h1 class="HedingText">Registe r</h1>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td width="124"><div align="left" class="style3">Username*:< /div></td> <td width="415">
<div align="left">
<input type="text" name="uname" maxlength="40"><?=$uname_e rror?>
</div></td></tr>
<tr><td><div align="left" class="style3">Password*:< /div></td> <td>
<input type="password" name="passwd" maxlength="50" onKeyUp="testPassword(docu ment.forms .passwordF orm.passwd .value)">
<?=$passwd_error?>Password Strength:
<input name="score" size="3" type="text"> Strength verdict: <input name="verdict" size="15" type="text">
</td></tr>
</form>
Im using a script that i found at http://www.geekwisdom.com/dyn/passwdmeter to check passwords and how strong they are against the specified rules. Im currently trying to implement it here: http://www.templateit.net/register.php but im getting errors when i try to do it. I cant spot why the error is occuring because it works fine for me on a plain html form and ive just copied over the same code. any ideas?
heres the form code, the js file is available from the above link.
<script type="text/javascript" src="javascript/passwordme
<h1 class="HedingText">Registe
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td width="124"><div align="left" class="style3">Username*:<
<div align="left">
<input type="text" name="uname" maxlength="40"><?=$uname_e
</div></td></tr>
<tr><td><div align="left" class="style3">Password*:<
<input type="password" name="passwd" maxlength="50" onKeyUp="testPassword(docu
<?=$passwd_error?>Password
<input name="score" size="3" type="text"> Strength verdict: <input name="verdict" size="15" type="text">
</td></tr>
</form>
Change this:
<input type="password" name="passwd" maxlength="50" onKeyUp="testPassword(docu ment.forms .passwordF orm.passwd .value)">
To this:
<input type="password" name="passwd" maxlength="50" onKeyUp="testPassword(this .value)">
<input type="password" name="passwd" maxlength="50" onKeyUp="testPassword(docu
To this:
<input type="password" name="passwd" maxlength="50" onKeyUp="testPassword(this
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You did not copy the first character from my upper example.
You have this:
************************** ********** ********** ********** **** */
unction testPassword(theField){
You have this:
**************************
unction testPassword(theField){
ASKER
Silly mistake, sorry.
thanks for the help, that works great.
thanks for the help, that works great.
You are welcome.
Your form does not have a name. Based on your code it should be named "passwordForm"
Also I don't know if I'd use the onKeyUp method for this. I would think onBlur would be more appropriate, but since I don't know exactly what the function is doing I can't say that for sure.
Hope this helps,
Neal.