<scriptlanguage="javascript"type="text/javascript"> /* Visit http://www.yaldex.com/
for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin function
validatePwd(){ var
invalid =" ";// Invalid character is a space var
minLength =6;// Minimum length var
pw1 =document.myForm.password.value; var
pw2 =document.myForm.password2.value; // check for a value in both
fields. if(pw1
==''||
pw2 ==''){ alert('Please
enter your password twice.'); returnfalse;
} // check for minimum length if(document.myForm.password.value.length<
minLength){ alert('Your
password must be at least '+
minLength +' characters long. Try again.'); returnfalse;
} // check for spaces if(document.myForm.password.value.indexOf(invalid)>-1){ alert("Sorry,
spaces are not allowed."); returnfalse;
} else{ if(pw1
!=
pw2){ alert("You
did not enter the same new password twice. Please re-enter your
password."); returnfalse;
} else{ alert('Nice
job.'); returntrue; } }
} // End --> </script> <formname=myFormonSubmit="return
validatePwd()"> Enter your password twice. <br> (At least 6 characters, 12 characters
max, and spaces are not allowed.) <br>
<pre> Password: <inputtype=passwordname=passwordmaxlength=12> <br> Verify password: <inputtype=passwordname=password2maxlength=12> <br>
</pre> <inputtype=submitvalue="Submit">
</form>