Validation (password)
This script works like our Password Verifier, however, it also checks for a minimum length and invalid characters.
| The JavaScript Source: Forms: Validation (password)
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Command-s). The script is yours!!!
|


Leave a Response
(4 comments)It doesn't work on this page, and it doesn't work on mine either. I figured I'd save time and rather than reinvent the wheel, I'd use yours but the submit button doesn't call the script it seems... Can you figure out why? Thanks
[removed] function checkForm(form) { if(form.username.value == "") { alert("Error: Username cannot be blank!"); form.username.focus(); return false; } re = /^\w+$/; if(!re.test(form.username.value)) { alert("Error: Username must contain only letters, numbers and underscores!"); form.username.focus(); return false; } if(form.pwd1.value != "" && form.pwd1.value == form.pwd2.value) { if(form.pwd1.value.length
it`s very helpful for me !
thanku for pulishing this code. please if you help me further. i am not getting hw to write code for making restriction on password i.e my password should contain atleast one lower case, upper case, numbers, special symbol. please if you can mail me your reply