W3C home > Mailing lists > Public > public-html@w3.org > January 2008

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

From: Hallvord R. M. Steen <hallvord@opera.com>
Date: Wed, 16 Jan 2008 14:17:46 +0100
To: "public-html list" <public-html@w3.org>
Message-ID: <op.t40xvw15a3v5gv@hr-opera.oslo.opera.com>

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
Core QA JavaScript tester, Opera Software
http://www.opera.com/
Opera - simply the best Internet experience
Received on Wednesday, 16 January 2008 13:17:35 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:52 UTC