Solved

Dynamically create and submit a form in FireFox

Posted on 2007-11-15
2
1,368 Views
Last Modified: 2013-12-07
This code works in IE and Opera, but not in FireFox, how do I make it work in FireFox:

function DoIt()
 {
                var sHTML = "";
                sHTML += '<FORM id="formBlah" method="POST" action="/save_blah.php">';
                sHTML += '<INPUT TYPE="hidden" NAME="courseId" VALUE=\'1\'>';
                sHTML += '<INPUT TYPE="hidden" NAME="certId" VALUE=\'1\'>';
                ...
                ...
                sHTML += '<br><input type="submit"><br>';
                sHTML += '</FORM>';
               
                document.getElementById("divBlah").innerHTML = sHTML;
                document.getElementById("divBlah").document.getElementById("formBlah").submit();
 }
....
....

<DIV id="divBlah" style="visibility:hidden">
</DIV>
0
Comment
Question by:mobile1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Accepted Solution

by:
gops1 earned 250 total points
ID: 20295304
Just use this:

document.getElementById("formBlah").submit();
0
 
LVL 3

Expert Comment

by:kylealanhale
ID: 20295339
There are a couple of things you can try.  One would be to give the submit button an id and call buttonId.click().  The other would be to use DOM functions instead of innerHTML.  If you don't want to build them from scratch, try my method for DOM building: http://jsoda.info/.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question