[whatwg] questions regarding submit event timing

(Thanks to those clarifying the sync/async event question  :-))

2011/5/3 Jonas Sicking <jonas at sicking.cc>:
> Isn't the purpose of this flag mostly backwards compatibility, but
> otherwise a fairly awkward feature. If so, it seems like we should
> limit its scope as much as possible, both to make implementation
> easier, and to make the forms API otherwise as simple as we can.

It seems to have two purposes:
1) avoid doing form validation on form.submit()
Definitely a backwards compatibility feature, and one that yours truly
probably caused by complaining when form.submit() was specified to
throw an exception when the form didn't validate. This broke websites
left, right and center when implemented in Opera.

2) Avoid firing a submit event.
What is more intuitive for button.click() or a synthetic click event
on the button - submit event firing? I guess so, in that case the spec
as-is is OK though it's a bit counter-intuitive that other scripted
ways to submit a form than .submit() don't set the scripted-submit
flag.

-- 
Hallvord R. M. Steen

Received on Thursday, 5 May 2011 04:36:45 UTC