[whatwg] :invalid

On 9/24/10, Boris Zbarsky <bzbarsky at mit.edu> wrote:
> On 9/23/10 6:12 PM, Mounir Lamouri wrote:
>> So, to improve the user experience while using web forms we would like
>> to fix that. However, we are wondering if :invalid (and :valid?)
>> specifications should be updated to take UX considerations or if a new
>> pseudo-classe should be created. Does anyone has an opinion about that?

personally i see nothing terribly wrong w/ coopting the current pseudos.

> I was actually thinking about this the other day...  We could add a new
> pseudo-class for matching form controls that have their default value
> (or that don't, depending on how we expect this to be used).  then you
> could style :invalid:not(:has-default-value) specially, say....
>
> Or I suppose we could just add a new pseudo-class that means the above.
>
> Are there cases when pages would set invalid default values and want
> them flagged as such in UI?

assuming server round tripping instead of ajax style login, consider
the google login field

1. there's a username field, which upon initial submission is replaced
by static text
2. there's a password field, which upon initial submission with the
wrong password is supplemented by a "your username/password aren't
correct"

here, google is trying to highlight that there once was an incorrect
password (which was wrong) but it has left the field blank.

fwiw, i recall complaining symbian's account signup because it
aggressively flagged initial bad input. things like going red as you
enter the first letter into an email address field or the first letter
of a password with a minimum length requirement.

consider account creation where the user has:
account name
password1
password2

the password2 field quickly becomes bad as the user fills in the
password1 field. the behavior symbian was using was stupid (telling
the user they don't match as the user is filling them in), but it
doesn't seem like an uncommon initial draft behavior from a web dev.

i think some usability recommendations could be helpful (beyond the
spec requirements and reasonable classes), not sure where, since
clearly people don't read (and rarely think).

Received on Sunday, 26 September 2010 03:39:24 UTC