[Bug 7411] :invalid and :out-of-range shouldn't match until the user has consciously interacted with the form. Roughly, after the input fires a change event. If, say, <input required> matches :invalid immediately on pageload, it becomes basically useless.

http://www.w3.org/Bugs/Public/show_bug.cgi?id=7411


Ian 'Hixie' Hickson <ian@hixie.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX




--- Comment #2 from Ian 'Hixie' Hickson <ian@hixie.ch>  2009-09-21 10:40:55 ---
Surely if the user loads a form, sees there's nothing wrong, and hits submit,
that's worse than if the user loads a form and sees a lot of red before typing
anything?

Also, what about forms that did round-trips through the server? Surely those
will want to be red straight away, regardless?

It seems like if you want what you describe, you should just do this:

   <form onchange="event.target.classList.add('dirty')">

...and then in the CSS use ":invalid.dirty" instead of ":invalid".


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Monday, 21 September 2009 10:41:09 UTC