Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Firefox form submit issue

 
David Erin
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your form have an id attribute?

If not MSIE (wrongly) uses the name attribute when doing a getElementById search. Firefox does not.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic