W3C home > Mailing lists > Public > public-html@w3.org > July 2010

Bubbling of 'invalid' event, 'valid' event

From: Kornel Lesiński <kornel@geekhood.net>
Date: Fri, 30 Jul 2010 12:08:53 +0100
Message-Id: <98443242-8423-4796-9130-6C557179B477@geekhood.net>
To: public-html@w3.org

Currently 'invalid' event is a simple event that does not bubble. Is there a reason for it not to bubble?

Usually form errors are displayed in a similar fashion for all controls, and with bubbling event authors would be able to use just one handler for all controls:

<form oninvalid="display_fancy_message(event.target.validationMessage); return false">


There's no 'valid' event that would allow scripts to reverse changes made in the 'invalid' event handler (e.g., hide error message when value becomes valid again). Although  it's not strictly necessary (can be worked around with oninput and input.validity.valid), such event seems logical counterpart to 'invalid' event and would make custom error display easier to implement.

XForms had both 'valid' and 'invalid' events, and they were bubbling.

-- 
regards, Kornel
Received on Friday, 30 July 2010 11:09:32 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:19 UTC