[whatwg] :invalid

Benjamin Poulain benjamin.poulain at nokia.com
Mon Jan 3 08:31:54 PST 2011

On 12/31/2010 02:13 AM, ext Ian Hickson wrote:
> It's not entirely clear to me what the intended UI is here. If the goal is
> to only style form elements for (in)validity after they've lost focus or
> after their form is submitted, it seems a couple of scripts on<form>
> would be the way to go:
>     <form onblur="event.target.classList.add('examined')"
>           onsubmit="for (var i = 0; i<  elements.length; i += 1)
>                       elements[i].classList.add('examined')">
> ...along with CSS rules like:
>     .examined:invalid { ... }
>     .examined:out-of-range { ... }
> On Thu, 23 Sep 2010, Boris Zbarsky wrote:
>> Are there cases when pages would set invalid default values and want
>> them flagged as such in UI?
> On Fri, 24 Sep 2010, Shiv Kumar wrote:
>> Typically, in large organizations, there are folks who clean up data. So
>> they will be presented with data that's already entered by someone else
>> and their job is to clean up the data. In fact I see the new Form API to
>> be a very good candidate for this use case.
> Indeed.

Isn't that targeting the wrong audience?

I think the use case you solve with .examined:invalid is quite common.

On the other side, batch clean up of data is a special case for 
enterprises. And can image those systems validate on server side and 
would not benefit much from :invalid.


More information about the whatwg mailing list