W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2005

[whatwg] Web Forms 2 stable draft draft

From: Olav Junker Kjr <olav@olav.dk>
Date: Mon, 07 Feb 2005 18:50:07 +0100
Message-ID: <4207AA4F.5050704@olav.dk>
You write:
 > The model used by the validity  DOM attribute is not very clean, and
 > may deserve to be replaced with something that has been thought
 > through with more care

Perhaps the bit field interface could be left out. The only thing that 
can't be done through the properties, is easily checking if the field is 
valid or not, like:
   if (field1.validity) ...
This could be supported by having the validity attribute return null 
when the field is valid. The ValidityState object would then alway be 
the description of an error.
This may be a bad idea though, since code like:

   if (field1.validity.isPatternMismatch) ...

would generate an error when the field is valid.
A better solution would perhaps be to add an attribute, "isValid" to 
ValidationState. So you could write:

  if (field1.validity.isValid) ...

Only problem is that the naming seems a bit strange. "validityState" 
would be clearer than "validity", but also a bit more cumbersome.

Anyway, it seems a bit redundant to support both the bit field and 
property interfaces.

regards
Olav Junker Kj?r
Received on Monday, 7 February 2005 09:50:07 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:21 UTC