ID3TECH
asked on
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.docum ent.getEle mentById(' myForm').s ubmit();
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.
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.docum
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.
ASKER
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
Is it possible to have some of your code? Both main page and iframe?
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
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
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
ASKER
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
frames["myframe"].document
or
frames["myframe"].__doPost