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

Posted on 2006-04-07
Last Modified: 2008-02-01
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.
Question by:ID3TECH
    LVL 9

    Expert Comment

    If your Iframe is named "myFrame", do this:




    Author Comment

    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
    LVL 9

    Expert Comment

    Is it possible to have some of your code? Both main page and iframe?
    LVL 75

    Expert Comment

    by:Michel Plungjan
    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:
    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)


    Author Comment

    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.

    Accepted Solution

    PAQed with points refunded (500)

    Community Support Moderator

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Suggested Solutions

    "That which we persist in doing becomes easier, not that the task itself has become easier, but that our ability to perform it has improved." Ralph Waldo Emerson Introduction: One of the wonderful things about the web is that it makes it s…
    Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now