Entry
How can i close the active window (eg. a javascript popup) with a form, when the visitor pushes the submitt-button?
Jun 26th, 2001 03:51
Iain Bruce, Thomas Hernes,
In with the "input type=submit" tag, add
onClick="javascript:window.close()"
so
<input type=submit value="Send stuff, and close window"
onClick="javascript:window.close()">
If you are doing it with Perl, you can add the onClick to the submit
like this (assumes you are using CGI.pm)
$query->submit(-value=>'Send stuff, and close window',
-onClick=>'javascript:window.close()');
I have not been able to test the syntax of the Perl solution but from
memory believe it works. The first answer has been tested and does what
you request.
One way or another - hope this helps.