W3C home > Mailing lists > Public > www-forms@w3.org > May 2000

Re: when to validate

From: Neil Walker <neil.walker@mrc-bsu.cam.ac.uk>
Date: Thu, 4 May 2000 11:50:03 +0100 (BST)
To: www-forms@w3.org
Cc: neil.walker@mrc-bsu.cam.ac.uk
Message-Id: <E12nJDq-0001qv-00@bernstein.mrc-bsu.cam.ac.uk>
A bit late in the day, as I'm new to this list ...

Joe Hewitt wrote, back on 20th April:
> In some cases, the form designer may wish to specify that a field should be
> validated immediately after the user changes it's value, rather than at the
> time the form is submitted.
>
> Each element should have an attribute called "validateon", with possible
> values of "change", "submit", "never".
>
> Sound useful?

If you're going to allow "Field and Data Dependencies" (requirements
doc, section 3.6), then you'll need to validate individual content as
you go along.  And equally, if a set of fields can only be valid in
combination, you want to defer validation till they're all complete -
which given a form need not be entered in top-to-bottom order, is
probably most easily attempted on submission, or with a "Validate Group" 
button.

The question then is how to associate validation scripts with form
elements:  I would go for a validate="script()" facet/attribute on
every data item, on groups, on any button, and on the form itself.
Basically you want as much validation done as possible before the data
gets sent along to the receiving CGI script, and you want to associate
the scripts with the level at which they operate.

Cheers
Neil
--------------------------------------------------------------------
Neil Walker                     tel:   +44 (0) 1223 330379
MRC Biostatistics Unit          fax:   +44 (0) 1223 330388
Cambridge, UK                   email: neil.walker@mrc-bsu.cam.ac.uk
                                web:   http://www.mrc-bsu.cam.ac.uk 
--------------------------------------------------------------------
Received on Thursday, 4 May 2000 06:51:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:47 GMT