[whatwg] UA validation and the submit event

Jim Ley jim.ley at gmail.com
Wed Jan 18 02:22:11 PST 2006


On 1/18/06, Hallvord Reiar Michaelsen Steen <hallvord at hallvord.com> wrote:
> 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.

But it still doesn't fire if the useragent prevents validation?
 That would certainly be safer than as I read your previous proposal,
I'm not confident it wouldn't break some legacy pages.

> I'm not sure if making that impossible would be a big limitation.

Certainly not for future scripts, but the problem is the authors
who've never heard of Web Forms 2.0...

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

Voted???

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

Couple of points to note off the top of my head:

  WF2 aware scripts need to know that validation happened and failed.

  Legacy scripts need to know if a form was submitted - you can only
do this by not ever suggesting that it had been as far as I can see
which means not firing onsubmit event.

So I would certainly agree that firing onsubmit after form validation
is the only way to ensure backwards compatibility, it may be that we
need an onaftervalidation type thing which fires after validation is
complete so WF2 aware UA's can do the same disabling/screen tidy up
that we want to do.

Note I don't think this will still be compatible with all legacy
clients, there's lots of scripts of the type:

<a onclick="disableUI();documente.forms[0].submit();">

where non form controls are used for the submission, so I don't think
either of the proposals are going to be perfect, which is why I think
it's important to ensure that user agent validation can only occur
with the explicit awareness of the author - not as a byproduct of
including another attribute.

Cheers,

Jim.



More information about the whatwg mailing list