[Bug 19751] Constraint Validation - Add a means of detecting invalid form submissions

https://www.w3.org/Bugs/Public/show_bug.cgi?id=19751

--- Comment #2 from TJ VanToll <tj.vantoll@gmail.com> ---
(In reply to comment #1)

> > At the moment you have to listen for anything that might trigger a
> > submission (usually clicks of submit buttons) and run the appropriate logic
> > there.  I give concrete code on how I've implemented this here
> > http://tjvantoll.com/2012/08/05/html5-form-validation-showing-all-error-
> > messages/.
> > 
> > While this works it is not ideal.  An event fired on the form whenever a
> > form submission was attempted and failed (much like invalid on form
> > elements) would make the implementation much simpler.
> 
> This is quite simple actually. See this example:
> http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=1870

The issue with this approach is that the logic will run once per invalid field
on the form.  If you give an invalid email address in your example you'll end
up with two alerts.  Unless I'm missing something there's no way to run the
logic just one time per attempted submission with the current API.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Tuesday, 30 October 2012 02:03:13 UTC