Re: HTMLFormElement submit Method

On 11/02/02 19:22, "Philippe Le Hegaret" <plh@w3.org> wrote:

> On Tue, 2001-12-11 at 14:04, Steven Elliott wrote:
>> Microsoft (MSDN site) claims that the submit method of a form does not
>> invoke the onsubmit event handler.
>> 
>> Microsoft goes on to claim on the same page that this method (submit method)
>> is defined in the W3C DOM Level 1.
>> 
>> The reference I find for the HTMLFormElement in the DOM is section 2.5.5.
>> Object Definitions.  Here it defines the submit method as performing the
>> same action as a submit button which implies invoking the onsubmit event.
>> 
>> I cannot find any specific reference here for whether or not the onsubmit
>> event should or should not be included.
>> 
>> Can you clarify this please because I believe not calling an onsubmit method
>> if one is defined for a form would be a violation of the W3C L1 DOM?
> 
> Unfortunately, given the differences between implementations, it was not
> possible to find a common ground on this issue. No changes were in the
> specification. You cannot rely on having an event when invoking the
> submit() method.
> 
> Please, let us know if you are (or are not) satisfy with this decision,
> 
> Philippe,
> for the DOM WG.
> 
> 
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.

Thank you for your consideration.

Steven Elliott           <elliott@mail.cibertribe.pt>
Systems Integrator
Interactive Tecnologia, Lda.
Lisbon    Portugal

tel: +351 21 440 8090
fax: +351 21 441 7242
-- 

Received on Monday, 11 February 2002 15:14:14 UTC