[whatwg] Comments on Web Forms 2.0 Working Draft

Matthew Thomas mpt at myrealbox.com
Thu Jun 17 00:43:52 PDT 2004

On 17 Jun, 2004, at 4:10 AM, Ian Hickson wrote:
> On Fri, 11 Jun 2004, Christian Schmidt wrote:
> ...
>> The custom validation could be done in onchange or oninput, but that 
>> may turn out to be too often or too rare.
> Why?

It would be too often in any situation where there are three or more 
variables competing for a shared resource. If there were two, you could 
automatically adjust the one that wasn't being altered to match; but if 
there's three or more you can't.

Example 1:
| Rank the candidates 1, 2, 3 in order of preference:
| [ 2] Sonja Gonzalez
| [ 1] Hubert Appleton
| [ 3] Tracy Ming
Here validation would consist of ensuring that (a) you'd only used 1, 
2, and 3, and (b) you hadn't entered the same number twice. But if such 
validation was done onchange it would be impossible to change anything, 
because getting from any valid state to any other valid state 
necessarily passes through an invalid state.

(A more convenient, but slightly less obvious, alternative to the above 
text fields would be a 3*3 grid of radio buttons. But the same 
validation problem would apply.)

Example 2:
| The safari will last for 7 days. How many days do you
| want to spend on each activity?
|    Hippo wrestling: [ 2] ====V==========
|   Meerkat watching: [ 4] ========V======
| Wildebeeste racing: [ 1] ==V============
|                          0 1 2 3 4 5 6 7

>> If validity is the sum of several ERROR_* constants including 
>> ERROR_USER_DEFINED and the UA only displays the error message related 
>> to one constant at a time, it would probably make sense to display 
>> the one set with setCustomValidity() first (it would probably be more 
>> specific than the standard messages). I don't know whether this 
>> behaviour should be required by UA's or even suggested in the spec.
> Yeah. It's up to the UA.
> ...

Ideally UAs should be able to display all error messages at once, 
under/beside the relevant control(s) in the page itself, like current 
forms validated server-side do. Displaying a stream of alert boxes 
would be a degradation from that.

Matthew Thomas

More information about the whatwg mailing list