On Nov 15, 2:45 am, sprach wrote:
<snip>
> ... .  In the code
> above, firebug claims that form.submit() is not a function.

The DOM allows named form controls to be accessed as named properties
of the FORM element object. However, the FORM elements have a set of
properties/methods of their own, including the - submit - method. So,
in the event that any form control has the same name as a pre-existing
property of the FORM element the reference to the form control
replaces the value of the pre-existing property of the FORM element.

If one of the form controls you are using (say a submit button) has
the name 'submit' a reference to that button would replace the FORM
element's - submit - method, and so if you attempted to call the
method the browser's error reporting mechanism would tell you that
what you were trying to call was 'not a function'.

Javascript is case sensitive so this sort of issue can be addressed by
applying a simple naming strategy to form controls, such as giving
each an initial capital letter in their name.

Reply via email to