multiple form submits happening on window close

Discussion in 'Javascript' started by Kuntal Joisher, Sep 6, 2003.

  1. Hi all,

    Initially I have a page with a button. When the user clicks the button
    a pop up window is opened up.

    the main content is in this popup window. The popup window consists of
    a bodyframe and a tracking frame. The tracking frame consists of a
    hidden form. Also in the <body> of tracking frames HTML page I have
    onunload='somemethod()'.

    This somemethod() submits the hidden form on that page. I set the
    response to be sent to parent.opener (i.e. the main window which
    opened this popup)..

    So now, when somebody clicks on the x of the popup window (i.e. closes
    it) -- somemethod() function is called (since the tracker frame got
    unloaded)..and the form submit happens...and the response to this form
    submit is a HTTP 204 ..which is sent to the opener window..and since
    it is a 204 browser does nothing..Everything works fine..

    But now if someone closes the opener window(the main window)...before
    closing the popup --
    so now if they close the popup window, the hidden form is submitted
    twice!!!!!!!!!!!...Also an additional blank window comes up which has
    URL as the action of the form!!!!!!!

    I am not sure what is happening out here. Could somebody please
    explain???

    --Kuntal.
     
    Kuntal Joisher, Sep 6, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt Jensen
    Replies:
    1
    Views:
    5,252
    Matt Jensen
    Dec 16, 2005
  2. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    User Controls with Form fields & Multiple Submits

    =?Utf-8?B?QWxleCBNYWdoZW4=?=, May 7, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    414
  3. Iñaki Baz Castillo
    Replies:
    7
    Views:
    893
    Iñaki Baz Castillo
    Jan 12, 2010
  4. Matthew Sims
    Replies:
    0
    Views:
    137
    Matthew Sims
    Mar 4, 2004
  5. Shang Wenbin

    close current window using window.close()

    Shang Wenbin, Sep 1, 2005, in forum: Javascript
    Replies:
    10
    Views:
    395
    Gérard Talbot
    Sep 2, 2005
Loading...

Share This Page