I have a main form with a number of (popup) subforms.
Each popup is defined to be 'dependent' on the main form, i.e. should close automatically when the main form is closed/reloaded.
Everything functions OK, but there is a browser-related difference: NS 4.x and NS 6.x show only one browser item on the bottom task bar; MS IE (6.2 in my case) shows the main browser task plus each subform as a separate item.
When I close/reload under NS there is no problem -- the task bar reflects the new situation.
Under MS IE 6.2 all the subforms remain as orphans, and throw an error when I manually close them.
In the code (included below, showing just one popup) I have included a redundant provision: when the main form unloads it checks each subform, and attempts to close it if open -- this line of code is executed but does not close the subform.
TIA for help with this problem ...
JimHH
Each popup is defined to be 'dependent' on the main form, i.e. should close automatically when the main form is closed/reloaded.
Everything functions OK, but there is a browser-related difference: NS 4.x and NS 6.x show only one browser item on the bottom task bar; MS IE (6.2 in my case) shows the main browser task plus each subform as a separate item.
When I close/reload under NS there is no problem -- the task bar reflects the new situation.
Under MS IE 6.2 all the subforms remain as orphans, and throw an error when I manually close them.
In the code (included below, showing just one popup) I have included a redundant provision: when the main form unloads it checks each subform, and attempts to close it if open -- this line of code is executed but does not close the subform.
TIA for help with this problem ...
JimHH
Code:
<script language="javascript">
var myWindow2 = null;
function Subbtn2() {
if ((myWindow2 !=null) && (myWindow2.open))
{
myWindow2.focus();
}
else
{
myWindow2=window.open('form_2.htm','myWindow2','dependent, ... etc ...');
if (myWindow2.opener == null) myWindow2.opener = self;
}
}
// Called from myWindow2 when manually closed
function null_2() {
myWindow2 = null;
}
function on_load() {
Subbtn2();
myWindow2.blur();
}
//
function un_load() {
if (myWindow2 !=null && myWindow2.open)
{
// *** FOLLOWING LINE EXECUTES BUT HAS NO EFFECT ***
myWindow2.close();
}
}
//-->
</Script>
</head>
<body onLoad="return on_load();" onUnload="return un_load();">
:
</body>
</html>