When I need to do something like this I usually do a combination of PHP and javascript. Something like this if(!$_POST['foo'])){ $javascript = "popUp();"; }else{ $javascript = null; } In the body tag just add <body onUload="<?=$javascript?>" > This way if the page has been submited by a form you won't see your popup. Hope this addresses your needs and I understand your question properly. Jonathan --- abhishek jain <ejaincom@xxxxxxxxx> wrote: > Hi Friends, > I need to create an application that will open a > popup > when the user closes a window. I can do that easily > via onUnload event of javascript but the catch is > that > the popup must open only when we close the window > and > not when we submit a form or click a link on the > page. > Actually it is a survey which opens only when one > closes the window. > I think i am clear. > Any help will be apreciated. > I am not sure that this is a problem with php or > html > but pl. help. > -- > Regards > Abhishek jain > > > > __________________________________ > Start your day with Yahoo! - Make it your home page! > > http://www.yahoo.com/r/hs > __________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com ------------------------ Yahoo! Groups Sponsor --------------------~--> Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/saFolB/TM --------------------------------------------------------------------~-> PHP Data object relational mapping generator - http://www.meta-language.net/ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-objects/ <*> To unsubscribe from this group, send an email to: php-objects-unsubscribe@xxxxxxxxxxxxxxx <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/