
February 3rd, 2005, 08:17 PM
|
|
Contributing User
|
|
Join Date: Apr 2007
Location: Miami, Fl. US
Posts: 522
Time spent in forums: 8 m 29 sec
Reputation Power: 2
|
|
|
Reset single value in form....
I have a form in which I have added some error trapping. Part of the error trapping is 2 password verification inputs. I have code that checks to make sure they match and sets the focus back to the original one. I want to make it clear the values entered into those 2 inputs also.
Anyone know how to do this?
My code:
php Code:
Original
- php Code |
|
|
|
<script language="javascript"> function checkform (form) { if (form.name.selectedIndex == 0) { alert("A name must be selected from the list."); form.name.focus(); return false; } if (form.psw.value == "") { alert("A password must be entered."); form.psw.focus(); return false ; } if (form.verifypsw.value == "") { alert("A password must be re-entered."); form.verifypsw.focus(); return false ; } if (form.psw.value != form.verifypsw.value) { alert("Your passwords did not match. Please enter again."); form.psw.value == ""; form.verifypsw.value == ""; form.psw.focus(); return false ; } return true; } </script>
Any ideas?
|