PDA

View Full Version : Close popup window


giuseppe74
06-24-2002, 02:00 PM
Hello to all!
I've a page with a form, when i click on the "Submit" button, i send the data to an asp page and i open a popup window called "Attesa".
When the asp page have received the form data, i have to close automatically the popup window...how can i do this?
Thanks,

Giuseppe

tamienne
06-24-2002, 03:32 PM
in the BODY tag of the asp page put in onLoad="self.close()"

giuseppe74
06-24-2002, 03:38 PM
the asp page must remain opened, is the other page, opened as popup window, that i have to close...

justame
06-24-2002, 04:02 PM
Originally posted by giuseppe74
is the other page, opened as popup window, that i have to close...

gui..
just a tryŽ putting this in the BODY tag of the "Attessa" page ...
onLoad="self.close()"

tamienne
06-24-2002, 04:03 PM
Sorry, i misunderstood you.

Try something like

ASP: onLoad="Attesa.close()";

giuseppe74
06-24-2002, 04:15 PM
for justame: if i put the self.close on the popup page it will close the page, but i want to close the popup from another page

tamienne i've tried but it doesn't work :(

tamienne
06-24-2002, 04:22 PM
What error are you getting?

Can you post a url or code so we can look?

giuseppe74
06-24-2002, 04:37 PM
none errors, just the popup don't close!

this is an example i made on two html pages:

page one (prima.htm):

<a href="seconda.htm" onClick="window.open('attesa.htm','attesa','width=300,height=300');">Clicca</a>

page two (seconda.htm)

...i don't know what write to close the attesa.htm

page attesa.htm

..just remain opened till seconda.htm close it...

can you help me? :)

tamienne
06-24-2002, 06:23 PM
on seconda.htm call the window.open again with the same name. This gives you the window handle so you can close the window.

<script>
function closeIt(){
newWin=window.open('','attesa','width=300,height=300');
newWin.close();

}
</script>
</HEAD>
<BODY onLoad="closeIt()">

giuseppe74
06-25-2002, 08:14 AM
It works good!!!!!!
Really really thanks! :)