|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
||||
|
||||
|
Best way for Server Side Form Validation?
I usually create an error array and upon an invalid field, I add to the array. If there is anything in the array, I generate an appropriate message and take the user back to the original form.
Another way is to just write little procedures to check each field. Upon an invalid field, that procedure is executed. This method does not capture all the errors at once and usually takes the user back to the same old form for each mistake. Anyone else w/ a different/better approach? |
|
#2
|
||||
|
||||
|
Well, make a hash and use a flag. Check each field and if the value is invalid, set the value in the hash to some error identifier (eg Null) and set the flag. At the end, if you have a flag, rewrite the form where you can on the form generation process do the familiar RED font effect on the field name along with any descriptive. The form, naturally, populates the existing (valid) values.
|
|
#3
|
||||
|
||||
|
Quote:
Hmm, I like that approach. Users need to be told what they're missing on the page where they forgot to put the info. Thanks. And cool, you're in SF. =) |
![]() |
| Viewing: Dev Shed Forums > Web Site Management > Development Software > Best way for Server Side Form Validation? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|