• 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

TypeError: document.getelementbyid(...) is null

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[Added code tags - please see UseCodeTags for further details]

I want to submit above form. But it shows me JavaScript error in Console that
"TypeError: document.getelementbyid(...) is null"
This error is for code :
document.getElementById("my_form").submit();

I am using Firefox 24.0 and Windows 7. I have installed only 1 add-on. That is 'Firebug 1.12.3'.
This code works fine for other browsers Except Firefox.
Please help me to solve this problem.
 
author
Posts: 297
5
Android Firefox Browser Fedora
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Calling document.write() on an already loaded document will (in Firefox) automatically perform a document.open(), this will replace the document so your form will no longer exist.

However, why on earth are you using document.write() in the first place? Just create an element and add stuff with innerHTML.
 
Abhijeet Muneshwar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much. I could solve this problem by using 'innerHTML'.

Rob Crowther wrote:Calling document.write() on an already loaded document will (in Firefox) automatically perform a document.open(), this will replace the document so your form will no longer exist.

However, why on earth are you using document.write() in the first place? Just create an element and add stuff with innerHTML.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic