View Full Version : Opener waiting for child ?!

Rune Carlsen
03-16-2005, 07:46 AM

I want to accomplish the following.
I have a window/form. On this form I have a checkbox. If the checkbox is checked, and the submit button is clicked, another windows should be opened (no problems so far). The problem starts now. When this new window is submitted or closed, THEN the first windows should do the real submit, automatically. Meaning, it should not be submitted until the new window has been closed (submitted or just closed). Anyone have a idea?


03-16-2005, 08:04 AM
If i remember correctly IE offers an "onClose" event, but this is only IE and/or browsers nowadays are starting offer the possibility to disable this function. So this is probably not the good way.

Another option is to make a timer that checks whether the window exists on a regular basis. For example, declare a global new_window variable, in your head section, or outside your functions (if you use an external js file). Then, in the onsubmit part of your form do something like "new_window=window.open(optionshere); return false;"

Then you could make a timer, using isset() on one of the windows properties to check if the windows still exists, and submit the form if it doesn't.