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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to