PDA

View Full Version : Quick Unload Situation here...


ucm
10-26-2003, 12:21 PM
Hey guys,

I'm working on my squirrelmail client-side pages and i was wondering if anyone out there knows of a way to cancel an unload request to achieve:

* user goes to compose a new msg
* they type in a msg
* they then try to goto another website before they send
their msg
* a confirm dialog box pops up asking if they want to
continue with the page unloading or to cancel that to
finish their e-mail

basically, think a regular application like word after opening and THEN modifying a document and before you save it, just click the 'X'... you'll get a "Your document has changed, would you like to save it?" msg

that's what i'm going for here....

Jon Hanlon
10-26-2003, 05:11 PM
Use the onbeforeunload() event handler in IE.

http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onbeforeunload.asp?frame=true

http://www.webreference.com/dhtml/diner/beforeunload/

ucm
10-27-2003, 02:28 PM
Sweeeeeeeeeet!!! thanx Jon!! :rocker: