• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Firefox form submit issue

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Wait for it ... wait .... wait .... NOW! Pafiffle! A perfect tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic