Re: HTMLFormElement submit Method

On Mon, 2002-02-11 at 15:14, Steven Elliott wrote:
> I am not sure to what you are referring to as *differences between
> implementations*.  In any case I am not satisfied.
> 
> Any means which permits the client to circumvent conditions placed upon the
> form submit method invalidates the purpose of having an onsubmit method
> (particullarly in light of the fact that it is used in 99% of cases as a
> validation tool). To my mind this is (permits) a grave abuse of an implied
> contract and the onsubmit method should be removed from the FORM object.  At
> the very least it should be boldly stated in any and all documentation that
> the onsubmit event IS NOT GUARANTEED to be called by the submit method.
> 

On Mon, 2002-02-11 at 04:57, John Keiser wrote:
> It should be defined to not fire onSubmit.  No JavaScript functions fire
> events that I know of (at least in forms).  onChange doesn't happen when
> you change .value or .checked.  It is not the user who is calling JS
> .submit().  It is the page designer.  We presume that the designer knows
> enough about his app that when he calls submit() without validating he's
> *deliberately* circumventing his stuff for whatever reason.  This gives
> the prog
> 
> IE, NS4.x, NS6.x, and Konqueror work this way.  What widely-used
> implementations *do* fire onSubmit() that make it impossible to define
> it this way in the DOM?


As mentioned in the previous messages, there are differences between
implementations regarding the HTMLFormElement.submit method. 
[[
In Spyglass Device Mosaic 3, the invocation of the submit() method
causes the firing of the ONSUBMIT event prior to performing its intended
semantics, and, if the event returns a value that is equivalent
(coercable) to FALSE, then those intended semantics (form submission)
are ignored.
]]
http://www.w3.org/2001/12/DOM-Level-2-issues#i6

We cannot change this implementation even if NS and IE are consistent on
this issue, therefore we reiterate our position: you cannot rely on
having an event when invoking the submit() method.

Philippe

Received on Wednesday, 27 March 2002 17:02:32 UTC