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

[whatwg] WebForms2 validity

From: Anne van Kesteren <annevk@opera.com>
Date: Fri, 09 Feb 2007 09:29:11 +0100
Message-ID: <op.tng26xrt64w2qv@id-c0020.oslo.opera.com>
On Thu, 08 Feb 2007 23:38:34 +0100, Sean Hogan <shogun70 at westnet.com.au>  
wrote:
> 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.

They are. The specification should say so much, actually. I think it  
clearly defines when something is valid and when it's not and what the  
objects and pseudo-classes have to reflect...

(You should be able to test this in Opera 9, if you want. It implements  
this stuff.)


> 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?


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>
Received on Friday, 9 February 2007 00:29:11 UTC

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