Bubbling of 'invalid' event, 'valid' event

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