• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Error Handling in Forms > Project II: Error Handling of Forms

Project II: Error Handling of Forms

Chances are that most people will fill out the form correctly. However, some will mistype their responses, some will skip information the marketing folk desperately need, and some will fill in the boxes with garbage just to enter the contest.

If you include some JavaScript to error-check the form before it's submitted to the CGI script, the marketing people will have less incomplete or nonsensical data to sort through. Error checking will also make the CGI programmer's life easier, because you can guarantee that the data will arrive in certain forms. This is a pretty lengthy script, so we will break it up into a couple of sections: First we will check for empty form fields and erroneous data entered by the user. In the next project, we will go over how to let the user know what is wrong. Because both of these projects are part of the same script, we will postpone reviewing each part until the end when we have the completed script.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint