multiple form submits happening on window close

K

Kuntal Joisher

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top