Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find if a child window is open or not?

Status
Not open for further replies.

agsenthil

Technical User
Mar 9, 2001
4
0
0
SG
Hi,

To have a Modal Dialog (that remains until user clicks OK)
in my HTML page, I use JavaScript method "window.focus()"
on the event of its "onblur". This works fine.

But when the Child Window is open, clicking on the SUBMIT Button of the Parent Window really messes up things badly.
It submits the Form of Parent Window - even when the Modal Child Window is open. I WANT TO STOP THIS.

From my Parent Window, how can I know whether a Child Window is open or not? If I know this, then I wont allow the Form in Parent Window to submit. Can I do that? Or is there any better way of doing this?

Please Help.

Thanks in advance.

Regards,
Senthil.
 
Creat a global variable and set it to 0.

var vPopUpWindow = 0;


When you call the popup window do this.

vPopUpWindow = window.open(. . .

The in you submit button code (You will have to trap the button click.) try this.

if (vPopUpWindow != 0 & !vPopUpWindow.closed)
{
return false;
} else
fromName.Submit();
}

-G

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top