when a form is submitted from the main window i want a pop up window
to open from the onclick event. i have that working, now how can i
close the pop up window from the main window after the main window
finishes loading? i've been racking my brain on this for the last two
days. here is the code for the parent window that i have been testing
with.
testfoo.htm is just a blank html page used for testing.
<head>
<title>Personne l Information</title>
<script language="javas cript" type="text/javascript">
var newWindow;
//alert(newWindow + " page load");
function openDialogWin() {
var height = "300";
var width = "500";
var x = (screen.width - width) / 2;
var y = (screen.height - height) / 2;
var Name = window.name;
//alert(height + ", " + width);
features = "height=" + height + ",width=" + width + ",left="
+ x + ",top=" + y;
features += ",menubar=no,re sizable=no,titl ebar=no,scrollb ars=no,status=n o,toolbar=no,me nubar=no,locati on=no";
var newWindow = window.open(une scape("/testfoo.htm"),
"newWindow" , features);
//alert(newWindow .name + " in openDialogWin") ;
return newWindow;
}
function closeDialogWin( ) {
if (newWindow && !newWindow.clos ed)
newWindow.close ();
}
</script>
</head>
<body onLoad="closeDi alogWin();">
<form method="post">
<input type="submit" name="foo" value="Submit"
onclick="openDi alogWin();">
</form>
</body>
</html>
sorry about the formatting... it looks ok in the editing window. if
anyone can clue me in on how to format the code for the boards, i'll
do my best to comply.
thanks in advance
jones
to open from the onclick event. i have that working, now how can i
close the pop up window from the main window after the main window
finishes loading? i've been racking my brain on this for the last two
days. here is the code for the parent window that i have been testing
with.
testfoo.htm is just a blank html page used for testing.
<head>
<title>Personne l Information</title>
<script language="javas cript" type="text/javascript">
var newWindow;
//alert(newWindow + " page load");
function openDialogWin() {
var height = "300";
var width = "500";
var x = (screen.width - width) / 2;
var y = (screen.height - height) / 2;
var Name = window.name;
//alert(height + ", " + width);
features = "height=" + height + ",width=" + width + ",left="
+ x + ",top=" + y;
features += ",menubar=no,re sizable=no,titl ebar=no,scrollb ars=no,status=n o,toolbar=no,me nubar=no,locati on=no";
var newWindow = window.open(une scape("/testfoo.htm"),
"newWindow" , features);
//alert(newWindow .name + " in openDialogWin") ;
return newWindow;
}
function closeDialogWin( ) {
if (newWindow && !newWindow.clos ed)
newWindow.close ();
}
</script>
</head>
<body onLoad="closeDi alogWin();">
<form method="post">
<input type="submit" name="foo" value="Submit"
onclick="openDi alogWin();">
</form>
</body>
</html>
sorry about the formatting... it looks ok in the editing window. if
anyone can clue me in on how to format the code for the boards, i'll
do my best to comply.
thanks in advance
jones
Comment