SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Nov 2005
    Location
    Midwest
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Clear IFrame Issue

    Hello

    I am using JavaScript to post data to an IFrame. Between submit clicks, I am trying to clear out the IFrame so when the user clicks submit, the previous result is not mistaken for the most recent submit click. The way I am trying to accomplish this is posting 2 forms. The first from posts a blank HTML page. The 2 form posts the actual results from the submit click. My problem is the blank page is never displayed.

    Here is my javascript logic.

    document.clearIFrame.submit();
    document.submitResults.submit();

    Here are my forms.

    <form name="clearIFrame" id="clearIFrame" method="post" action="html/blank.htm" target="resFrame">
    </form>

    <form name="submitResults" id="submitResults" method="post" action="SubmitResultsServlet" target="resFrame">
    </form>

    If I brake this up into 2 separate button clicks (one button for clearIFrame and a second button for submitResults) the blank page is displayed. But when I execute them together, the blank page is not displayed.

    Any ideas on how I can get this to work so the blank page is displayed but the user only has to click the button once?

    Thanks in advance for your time.

  2. #2
    SitePoint Guru
    Join Date
    Nov 2005
    Location
    Midwest
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The way I got this to work was to break both form posts into separate functions and I used setTimeout.

    setTimeout ( "submitResults()", 100 );

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2009
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    Would it be possible for you to please rephrase your description. I am not really able to understand what you are trying to do.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •