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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making a window modal?

Status
Not open for further replies.

rhowes

IS-IT--Management
Jun 6, 2001
140
0
0
ZA
Hi

I have a page on which I have the following:

<body onfocus=&quot;checkPopups()&quot;...

The function is:

function checkPopups(){
if(oPopup){
oPopup.focus();
}
}

To open a popup I use the following:

oPopup=window.open('page.htm....

So if the popup is open and the user clicks on the background page then focus is returned to the popup, effectively making it modal. This works great if I click the opener page once, focus is returned to the popup. However if I click the opener window again the onfocus event for the opener page does not fire.

If I manually set focus to the popup window (by clicking its toolbar button) and click the opener document once again, the onfocus fires and the popup retains focus, but a second click does not work.

I may not have explained this well but basically the first click off the popup has the desired effect (it remains modal) but the second click off the window does not work.

Any ideas?
Thanks in advance.

Cheers
Richard
 
Hi rhowes,
You can use this
window.showModalDialog(&quot;first.html&quot;,&quot;resizable=no&quot;);
But this will work only on IE and not with Netscape.
[atom]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top