W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2006

[whatwg] UA validation and the submit event

From: Jim Ley <jim.ley@gmail.com>
Date: Tue, 17 Jan 2006 14:15:31 +0000
Message-ID: <851c8d310601170615v56d44d8fgeffab5788e7d751f@mail.gmail.com>
On 1/17/06, Hallvord Reiar Michaelsen Steen <hallvord at hallvord.com> wrote:
> Kayak.com is in trouble because they've set a maxlength that is
> smaller than some of the data the script sets input value to. (I'm
> sending them some feedback about that). However, the site shows an
> interesting problem: the UA (testing in Opera 9) does not submit the
> form because of the validation problem, but the onsubmit event has
> been called, meaning the site has disabled its submit button. Hence,
> the user has no way to fix the data and resubmit (even if she
> actually understands what the error is).
>
> Should we really fire onsubmit if the UA prevents submitting the
> form? Button-disabling-on-submit scripting isn't exactly rare..

I think you have to fire onsubmit, there are also lots of other things
people do onsubmit - copying information into hidden fields, calling
tracking scripts etc.  It's really an issue with the user agent.

The problem here is actually a problem of backwards compatibility,
current user agents do not stop submission when maxlength is too long.
 This means valid content, The HTML 4.01 doesn't say that having a
value longer than maxlength is an error, won't work in user agents.

You should implement the behaviour only for documents identified as a
Web Forms 2.0 user agent.

Jim.
Received on Tuesday, 17 January 2006 06:15:31 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:25 UTC