Re: [css-selectors] Empty input selector

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 UTC