W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > September 2009

[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.

From: <bugzilla@wiggum.w3.org>
Date: Mon, 21 Sep 2009 10:40:56 +0000
To: public-html-bugzilla@w3.org
Message-Id: <E1MpgKG-0002Vr-5Z@wiggum.w3.org>

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

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:01:01 UTC