Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close a pop-up contain form after 2 secs

Status
Not open for further replies.

avivit

Technical User
Jul 5, 2000
456
IL
I have a form (inside a pop up window) which it's action is cgi.
This cgi returns a message in the same window,
which I want to close after 2 secs.
It seems that once the cgi is performed, I loose
control over the window.
(If I replace 'return true' with 'return false', the window is closed
after 2 secs, but then not submitted of course).
TMy pop up has a name (x), but x.close() does not work
as well.


I tried:

<script language=&quot;Javascript&quot;>
function closeWin()
{ setTimeout('self.close()',2000); //x.close() does not work as well
return true;
}
</script>
<body>
<form action=&quot; onsubmit=&quot;return closeWin();&quot;>

Any ideas?
Thanks
 
&quot;It seems that once the cgi is performed, I loose
control over the window&quot; --> it's normal as onsubmit is performed BEFORE the call to the cgi
you should either close the window from the cgi or use another event handler !!!
 
Thanks iza.
I tried body onunload. Doesn't work either.
Probably from the very same reason.
I don't see other event that will do the job.
Do you?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top