I just now found out the hard way that, at least in FF3, IE7 and Chrome (all on Windows), adding a submit input element to a form makes calling the submit() method in JavaScript not work. Why on earth would this be? I wanted to place the input so users with JS turned off would still have a way to submit the form. This is annoying and very puzzling.
It's not adding an input of type submit that breaks this behavior, it's that you named the INPUT "submit". When you have a DOM node reference to a FORM tag, its submit property is usually a function that submits the form. When you create a form field or button whose name is "submit", then you overwrite the default submit function of the FORM with a node reference to the form field or button. It's best to not name form fields "submit", "title", "elements" or "name", as those are important properties of the FORM object.
Bookmarks