Meaningless Drivel is fun!
The moose likes HTML, CSS and JavaScript and the fly likes Firefox form submit issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Firefox form submit issue" Watch "Firefox form submit issue" New topic

Firefox form submit issue

David Erin

Joined: Dec 04, 2007
Posts: 10

The following code works fine in IE but not in Firefox.

The error is: myForm.submit is not a function

If i comment the following line , the form is submitted fine

Can anyone suggest waht i am missing here?

Thanks in advance.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Does your form have an id attribute?

If not MSIE (wrongly) uses the name attribute when doing a getElementById search. Firefox does not.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
As Ben said, make sure you have an id on the form tag. Make sure you do not have a submit button named submit on the form. That causes issues since it overrides the method submit on the form.

ALSO IE does not set the name attribute, so you may run into issues reading it on the server. Take a look at the code here:
which shows you how to get around that quirk. It might be easier to just add the hidden element to the form and reference it and set the value.

David Erin

Joined: Dec 04, 2007
Posts: 10
As Eric pointed out ,I had the property name as 'submit' which caused it to fail.

Works fine now.

Thanks guys for the help!
I agree. Here's the link:
subject: Firefox form submit issue
It's not a secret anymore!