> I would like to make javascript that when the window.onUnload is
> fired to pop up a confirm() saying "hey if you leave now your form
> information will not be saved.  Do you wish to continue?". But I think
> once onUnload fires there is no stopping the user from leaving the
> page.  Can you cancel onUnload once it fires?

I believe it's doable... not necessarily the best case for usability... 

however... 

in order to work across both IE and firefox/moz you have to use two
event handlers. In moz, "onunload" can be cancelled

<body onunload="return confirm('Lose your work?');">

in IE, the onunload event doesn't fire until after the browser is
already closed, however, they have a prioprietary onbeforeunload event,
so you can use that one instead to do the same thing for IE. Iirc you
don't have to do any special checking or anything, just copy whatever
you put in onunload into onbeforeunload also and you'll get the result
you want. 

I was asked to do this several years ago for a company in Ft Lauderdale.

hth,
ike

-- 
s. isaac dealey  ^  new epoch
 isn't it time for a change? 
     ph: 503.236.3691

http://onTap.riaforge.org/blog



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297963
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to