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

[whatwg] WebForms2 validity

From: Sean Hogan <shogun70@westnet.com.au>
Date: Fri, 09 Feb 2007 09:38:34 +1100
Message-ID: <45CBA66A.1040002@westnet.com.au>
I might be missing something obvious, but...

When are ValidityState properties updated? 
And when are CSS pseudo-classes (:valid, :invalid, :in-range, 
:out-of-range) updated? 

The spec doesn't say, so I tentatively assume they are meant to always 
be up-to-date. 

Many textual input form-controls would begin in one or another invalid 
state (valueMissing, patternMismatch) however authors would typically 
want CSS validity styles to apply only after checkValidity() - either a 
manual one or the automatic one performed by form-submission. 

Of course, one could always dynamically tag form-controls with some 
appropriate class (e.g. "validated") and hang your styles off that. 

input[type=text]:invalid.validated { background-color: red; }

Which wouldn't work when scripting is disabled, but should be sufficient. 

Anyway, could you clarify this? 

Ta,
SDH
Received on Thursday, 8 February 2007 14:38:34 UTC

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