[whatwg] [WF2] form.submit() should not throw if form is invalid

I think some changes are required to make WF2 more web-compatible. In
particular, we need a clean way JS can override WF2's validation.
Cancelling an invalid event just prevents the UA's built-in message -
we need something that makes submission happen anyway.

The best candidate is the submit() method - if we drop the requirement
that it  throws an error if the form is invalid. As specified, WF2
breaks *a lot* of pages which use custom JS libraries for validation,
trigger WF2 rules by coincidence and expect to be able to submit forms
with form.submit().

I suggest that the paragraph

    <p>Otherwise, if the form submission was initiated via the <code><a
     href="#submit">submit()</a></code> method, then instead of firing
     <code><a href="#invalid0">invalid</a></code> events, a
     <code>SYNTAX_ERR</code> exception must be raised (and submission is
     aborted) if any of the controls are invalid. <a
     href="#refsDOM3CORE">[DOM3CORE]</a></p>

is replaced with

    <p>Otherwise, if the form submission was initiated via the <code><a
     href="#submit">submit()</a></code> method, no validation takes place.</p>

Opera should implement this shortly due to the compatibility problems
with the current implementation.

-- 
Hallvord R. M. Steen

Received on Thursday, 10 January 2008 04:48:14 UTC