[whatwg] UA validation and the submit event

On 17 Jan 2006 at 14:15, Jim Ley wrote:

> 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.

I'm not suggesting that we shouldn't fire onsubmit at all, only that 
perhaps it would be more backwards-compatible if onsubmit took place 
after the UA validation. However your point is a good one: the site 
may want to do something in the submit handler that makes the form 
valid (such as giving a hidden required field a value).

I'm not sure if making that impossible would be a big limitation. I 
assume the scripts could use other events like onchange events of 
other form elements.

> The problem here is actually a problem of backwards compatibility

Exactly, that's what I'm worried about.

> 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.

HTML 4.01 says nothing about UA form validation so I don't think what 
it says is relevant.

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

I think we've been there, discussed that and voted against using any 
xmlns or DOCTYPE tweaks to distinguish a document as a WF2 one.

The only thing I want to discuss in this thread, is: should firing 
the onsubmit event and UA validation happen in reversed order to 
ensure backwards compatibility with scripts that believe a form has 
been submitted when it hasn't due to a validation error?

Note: I have not  read this section of the spec recently, comments 
are based on an implementation.
-- 
Hallvord Reiar Michaelsen Steen
http://www.hallvord.com/

Received on Tuesday, 17 January 2006 19:45:09 UTC