W3C home > Mailing lists > Public > www-style@w3.org > May 2011

Re: [css-selectors] Empty input selector

From: Ryan Seddon <seddon.ryan@gmail.com>
Date: Tue, 3 May 2011 09:15:54 +1000
Message-ID: <BANLkTinDXzD8Bat-2o4yPV1rwSdtFeyy2Q@mail.gmail.com>
To: Lea Verou <leaverou@gmail.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, Rudolph Gottesheim <r.gottesheim@loot.at>, www-style list <www-style@w3.org>
On Mon, May 2, 2011 at 11:27 PM, Lea Verou <leaverou@gmail.com> wrote:

> On 20/4/11 23:30, Boris Zbarsky wrote:
>
>> Do you really want to select form fields with an empty value, or invalid
>> required form fields?  There's certainly a selector for the latter!
>>
> FWIW, I remember needing this quite frequently, although I can't for the
> life of me remember why. :(


The one use-case for being able to tell if an input is empty is using it in
conjunction with the :invalid pseudo-class. Since a field is invalid even
without user interaction, being able to tell if the field is empty would
allow a developer to style an invalid field in a much more logical way.

However, Mozilla has taken initiative on this issue and added support for
the much more logical :-moz-ui-invalid pseudo-class. Whether or not either
of these get support, the use-case to me and I'm sure to many others is much
needed.

-Ryan
Received on Monday, 2 May 2011 23:16:45 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:40 GMT