|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
Form Error Trapping
I have a form that I need to add some advanced error trapping to. I need to this to make sure the form is filled out properly.
I would like to be pointed in the right direction on how to get started since it is rather complicated. So here is what I have. I have 1 check box: <input name="accrued_annual_leave" type="checkbox" value="AL"> And I have 5 inputs. They are: <input class="date_entry_area" name="accrued_al_date_from" type="text" maxlength="10"> <input class="date_entry_area" name="accrued_al_date_to" type="text" maxlength="10"> <input class="time_entry_area" name="accrued_al_time_from" type="text" maxlength="5"> <input class="time_entry_area" name="accrued_al_time_to" type="text" maxlength="5"> <input class="total_entry_area" name="accrued_al_total_hours" type="text" maxlength="3"> What I want to do is the following. When trying to submit, if "AL" is checked, for it to check to make sure all 5 inputs have values inside. Then, for it to focus to the one that is empty. And so forth. Then, if information is entered into any of those 5 inputs, for "AL" value to be changed to checked. Any ideas? |
|
#2
|
|||
|
|||
|
RE: Form Error Trapping
Hi
I have similar principals explained here > http://javascript.internet.com/forms/ |
|
#3
|
|||
|
|||
|
RE: Form Error Trapping
I'd suggest using a server-side script for validating post data, it is much more secure.
|
|
#4
|
|||
|
|||
|
RE: Form Error Trapping
I think he means he just wants some simple validating doing BEFORE submission.. using, for example, onChange= in the text fields.
IE: <input name="sd1" type="text" id="sd1" size="6" onChange="docalcs()"> That way, it is even more secure because it isn't travelling backwards and forwards with error messages. And the form only needs to be submitted once. |
|
#5
|
|||
|
|||
|
RE: Form Error Trapping
Cool. Found several good pieces of code in the page you suggested.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Form Error Trapping |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|