View Full Version : reload a textbox
reigalz
11-01-2002, 08:41 AM
i created four textboxes for the users to key in their particulars.
first box is for IC no., second is for telephone no., third is for name and fourth is for email address...
for example, if the user key in an invalid telephone no., how do i reload that particular textbox automatically for the user to enter his/her particular again, instead of reloading ALL the textboxes?
thanks!! :p
joh6nn
11-01-2002, 10:30 AM
i think we'd have to see more of the code that you're using, in order to be able to give you a relevant answer.
beetle
11-01-2002, 03:03 PM
regialz, I'm not positive, but it sounds like you need form validation. Check out fValidate (http://www.peterbailey.net/fValidate), a little form validator I wrote.
If this isn't what you need, then please, as joh6nn pointed out, give us some more info.
Thimo
11-02-2002, 12:41 PM
ok...here's my code:
<body>
<form name="confirm1" action="ConfirmBooking.jsp" method="post" >
<table>
<tr>
<td>
<b>NRIC or Passport No. (7 digits only)</b> :
</td>
<td>
<input type="text" name="NRIC" maxlength="7" size="10">
</td>
</tr>
<tr>
<td>
<b>Tel or Hp No. (8 digits)</b> :
</td>
<td>
<input type="text" name="Tel" maxlength="8" size="10">
</td>
</tr>
<tr>
<td>
<b>Email Account</b> :
</td>
<td>
<input type="text" name="Email" size="25">
</td>
</tr>
<tr>
<td>
<b>Name (as in NRIC)</b> :
</td>
<td>
<input type="text" name="Name" size="25">
</td>
<tr>
<td>
</td>
<td>
<input type="submit" value="Continue">
<input type="button" value="Cancel" onClick="gotourl()">
<input type="reset" value="Reset">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
chrismiceli
11-02-2002, 04:15 PM
I am not sure how you validation of the telephone works but this will work if it doesn't refresh or change the page
document.confirm1.Tel.value = "";
now if you want it to refresh only the incorrect field you will need some if statements in you validation.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.