Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 386
  • Last Modified:

form.submit() does not work in sub window in FireFox

Greetings Experts,
In my current window, I need to populate a form in a hidden IFRAME element, then I need to submit it.
I tried :
- iframe.contentWindow.document.getElementById('myForm').submit();
 or calling a function in that IFRAME that submits the form
 or the __doPostBack of ASP .NET of that window

None of these work in FireFox, and they do not even fire errors, so I do not know what to look for anymore.
Do any of you has an idea of how to bypass this?
Thank you experts.
0
ID3TECH
Asked:
ID3TECH
1 Solution
 
smaccariCommented:
If your Iframe is named "myFrame", do this:

frames["myframe"].document.getElementById('myForm').submit();

or

frames["myframe"].__doPostBack();
0
 
ID3TECHAuthor Commented:
nah, this is not the problem, I have the form object int he new window, and when I do an alert of the form.submit, it is indeed a function, but when I call it, nothing happens
0
 
smaccariCommented:
Is it possible to have some of your code? Both main page and iframe?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Michel PlungjanIT ExpertCommented:
No errors in the javascript console?

1. make sure you have <form></form>
2. make sure you do NOT have anything name="submit" or id="submit"
3. use the form access:
window.iframeName.document.forms[0].submit()
will submit the first form in the iframe unless of course the content of the iframe is not from the same server (that also means portnumber and protocol)

Michel
0
 
ID3TECHAuthor Commented:
Thanks for the help, but I just figured out it was because the Frame's style.display was set to none, so the javascript could not execute.
0
 
GranModCommented:
PAQed with points refunded (500)

GranMod
Community Support Moderator
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now