Click to See Complete Forum and Search --> : Modal Popup Windows in Netscape 4+


HumanError
07-16-2003, 02:13 PM
I am currently trying to create a modal window for my web application. I have gotten this to work in IE, but I am having trouble getting it working in netscape.

I have read several articles on the web that claim they have done this, and most of them work on IE, but all of them fail on Netscape.

The way I have gone about this is using the onFocus in the body tag of the parent window to check if the child popup is on top.

This method keeps the child popup on top in both Netscape and IE, but produces a rather odd effect in Netscape. After the focus is called upon the child popup, text fields in forms on the pop are inaccessable by mouse click (though I can still tab through the fields). I checked the textfield.disabled value and saw that it was set properly, even though I could not type in.

The following 2 pages are my test samples.

<html>
<head>
<title>This is the main window</title>

<script language="JavaScript">
PopUp = null;

function NewPopUp(location)
{
PopUp = window.open(location,'new_window','height=200,width=200');
}

function CheckForOpenWindow()
{
if (PopUp!=null)
{
this.blur();
PopUp.focus();
PopUp.document.form.status.disabled=false;
PopUp.document.form.status.value=PopUp.document.form.status.readOnly;
//PopUp.alert('Please close the popup window you were working on.');
}
}
</script>

</head>
<body onFocus="CheckForOpenWindow();">
This form is for testing with popup window evasion.<br>
<form action="deadend.html" method="post" name="form">
Put some text here. <input type="text" name="aname"><p></p>

<input type="button" value="Popup" onClick="NewPopUp('popup2.html');"><p></p>

<input type="submit" value="Submit">
</form>
</body>
</html>

<html>
<head>
<title>Pop up window</title>
</head>

<body>
This is the popup window.<p></p>

<form name="form">
<input type="text" name="status">

<input type="text" name="text2">
</form>

</body>
</html>

Khalid Ali
07-16-2003, 05:28 PM
Take a look at this link..
http://www.dynamicdrive.com/dynamicindex11/abox2.htm

HumanError
07-17-2003, 09:19 AM
That is not quite what I'm looking for. Perhaps I should have been a little more specific.

These pop ups need to be dealt with before the user can return to the parent window. That means all link clinks, forms, etc cannot be done on the parent window.

Its true that you can also disable the other things on the page, but to my understanding some form fields will show through in IE, and a bunch in Netscape.

Any other help will be greatly appreciated!