Self-closing javascript popup?
Posted: Tue Jan 13, 2004 8:11 am
Okay, I have a popup window used for correcting data that is displayed in html for neatness. The popup is invoked to make a correction and contains an edit box for making the correction as well as code to revise the databse. It works fine but the user must click to close the window after finishing. I would like for it to close automatically after the data is revised.
The window is invoked in the parent by:
Here is the pertinent code in reviser.php:
The window is invoked in the parent by:
Code: Select all
<a href=javascript:firstWindow('reviser.php?Doit=1',130,700)>Preparer:</a>");Code: Select all
<?php
if (isset($_POST['Cash']))
{
// misc code here processes $_POST var
mysql_query($Query, $Link);
// what can I put here to eliminate the "Close Window" href below ????
// exit; along with the above line
}
if ($Doit == 1) print("<TITLE>Preparer Text</TITLE>\n");
// misc code here opens database
if ($Doit == 1 || isset($_POST['Prep']))
{
print("<form method='post' action='reviser.php'>");
// misc code here displays form
print("<a href='' target='_parent' onClick='top.close()'>Close Window</a>");
print("<input type=image src='images/ag_okay.gif'>");
}
?>