Charlie,

> I know other people who subscribe to your 'one error at a time' theory.  I
> don't disagree with it...but I feel that if there are 10 (required)
> fields...and the user enters none...well what are the odds that the user
> isn't going to fill out a single field?  IMO, good design would dictate
> that
> you mark certain fields as required.  This would significantly cut down on
> the likelihood of the user having to deal with 10 javascript alerts, one
> at
> a time :)

Check out the sample code I just sent to you (and to the list.) qForms
handles trapping all the errors for you at one time, plus if the browser and
form field element supports it, it'll use CSS to highlight the field that's
causing the problem.

Required fields on a page definitely need to be clearly marked, but there
are times when requiring a field may depend on the value of something else
in your field. For example, maybe you have a select box w/a bunch of options
and then one marked "other". If the "other" option is highlighted, then a
text field value is required. qForms has a mechanism for handling this with
something called dependencies. To write that logic, all I need to do is type
one line of code:

oForm.otherText.createDependencyTo("selectOption", "other");

That line of code says that if the "selectOption" element is equal to other,
than the "otherText" field is now required. If it's any other value, the
field is optional.

> I advocate server side validation as well.  On the off chance that the

You absolutely need server-side validation. Server-side validation is the
only type of validation you have control over. There are too many ways to
bypass client-side validation.

However, this doesn't take away from the importance and value of client-side
validation. This is why I wrote qForms--to provide a powerful, flexible way
to write client-side validation that didn't take a lot of time to write.

Generally speaking, you should be able to add validation to a form in
minutes--and some even really complex validation at that. 

Also, it's important to remember that qForms is much more than just a
client-side validation library--it's main function is to be a full API to
allow you to add the RIA environment to the classic browser.

qForms has all the tools you need to build really complex RIA type
applications--without needing to learn other skillsets or leverage plug-ins.

-Dan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Get the mailserver that powers this list at 
http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to