[whatwg] Webforms 2 comments - add .validation usage examples and equivalent BNF for new input TYPEs

Brian Wilson brian at opera.com
Fri Aug 13 07:33:14 PDT 2004


When playing around with the .validation constants, I was having a hard  
time understanding how it worked. Yes, I read it a few times, and then had  
to have Ian spell it out yet again for me. I'm not sure if there is  
already DOM precedent for the binary value additive method of determining  
which validation errors have occurred, but for most this will need more  
explanation. I'd like to see at least one example of how this works  
(especially for combination validity errors), such as:

<input type="text" pattern="[0-9]{10}" name="inputype" value="93284"  
maxlength="4">

would trigger ERROR_TOO_LONG (16) and ERROR_PATTERN_MISMATCH (32), which  
would yield, when querying the .validity property for that form field a  
value of 48

------

When reading through the section on the new INPUT types, and trying to  
follow the prose descriptions of what characters are allowed/not allowed,  
I found myself wishing for a terse BNF string to reference. Perhaps  
prose-alone was chosen for a reason, but implementers - as well as some of  
us spec monkeys - have gotten used to BNF notation for a no-nonsense way  
of making sense of validity domains. Perhaps this can be added to the  
prose descriptions?

-Brian

-- 
Brian Wilson
Opera Core QA



More information about the whatwg mailing list