• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Reporting form errors to the user
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reporting form errors to the user


  • Subject: Reporting form errors to the user
  • From: email@hidden
  • Date: Thu, 8 Dec 2005 22:49:37 -0800

In my day job I build websites in a scripted environment. The "conventional wisdom" on handling form validation errors goes like this: the user goes to /foo and fills in the form. When they hit the submit button, they are routed back to /foo again, except this time it's a POST instead of a GET. The code within /foo is a giant if-statement - if the request is a GET, set up the input form. If it's a POST, validate the user's input and if there are errors, redisplay the form with the data filled in and error messages beside each field with problems. This is considered better than the alternative of sending the user to a second script which would then have to contain duplicate code to set up the form again if there were errors.

I have always hated this scenario; the files are large and unwieldy and the if blocks are sometimes so big that it's possible to try to debug the wrong one, wasting lots of time.

I was working on one of these monstrosities today and it got me wondering how this is handled in WO. I looked at all of my WO books, but I didn't see anything that covered this. Could someone give an overview (at a newbie level) of how this is done?

Thanks in advance,

janine

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Reporting form errors to the user
      • From: Chuck Hill <email@hidden>
    • Re: Reporting form errors to the user
      • From: wojingo <email@hidden>
  • Prev by Date: Re: WOExceptionPage (etc) customisation
  • Next by Date: Re: Reporting form errors to the user
  • Previous by thread: Re: WOExceptionPage (etc) customisation
  • Next by thread: Re: Reporting form errors to the user
  • Index(es):
    • Date
    • Thread