W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2011

[whatwg] Idea: pseudo-classes :valid and :invalid for whole form?

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 15 Jun 2011 15:35:37 -0400
Message-ID: <4DF90989.1030905@mit.edu>
On 6/15/11 3:12 PM, Eduard Pascual wrote:
> 2011/6/15 Boris Zbarsky<bzbarsky at mit.edu>:
>> No, it wouldn't.  The point here is to style based on a _form_ that is
>> invalid.  Whether a form is valid or not is up to the language defining
>> forms, that being HTML.
> Sorry, I assumed the simple definition that a form is invalid if it
> contains invalid input elements

A form need not contain its controls.  Consider this HTML document:

   <!DOCTYPE html>
   <form id="myform" action="something">
     <input type="submit">
   <input type="number" value="abracadabra" form="myform">

How would you select the form based on the valid/invalid state of the 
number input?

> and there are proposals on the wiki
> to deal with selecting an element based on its children.

Not good enough; see above.

Received on Wednesday, 15 June 2011 12:35:37 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:34 UTC