aspose file tools*
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


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Firefox form submit issue" Watch "Firefox form submit issue" New topic
Author

Firefox form submit issue

David Erin
Greenhorn

Joined: Dec 04, 2007
Posts: 10
Hi,

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
myForm.appendChild(hiddenField);

Can anyone suggest waht i am missing here?

Thanks in advance.
Ben Souther
Sheriff

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
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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: http://www.pascarello.com/examples/createElement.html
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.

Eric
David Erin
Greenhorn

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: http://aspose.com/file-tools
 
subject: Firefox form submit issue