Click to See Complete Forum and Search --> : disabling close button
Youngblood_97
08-18-2003, 11:56 AM
Searched around but didnt find anything on this subject. I am working on an application that would be very beneficial to disable the close x button in the top right of explorer so the persono doesn't lose all the information before they save their work. Is there a script for this or possible a script to pop up a message reminding them to save before they close?? Thanks in advance!!!
Khalid Ali
08-18-2003, 12:02 PM
a browser window triggers an
onunload
event when its being closed,however it might not work way too well since there is a difference between the implementation of this event in IE and NS,IE adds sort of delay to implement it threfore allowing you to get alert messaged and stuff where as NS I think does not allow u to do that..
Youngblood_97
08-18-2003, 02:16 PM
great thanks looking through some reference books but can't seem to find any good examples. Do you happen to know where I might find an example of this??
Youngblood_97
08-18-2003, 02:39 PM
Actually trying to only have the message come up when you click the x close button the message i have comes up on any link or anything. Is there any way to have this work like i intend?
EDIT:
This is what I have so far.
<SCRIPT LANGUAGE="JavaScript">
var msg = "Are you sure you want to close the window?";
if(confirm(msg)) window.close();
</script>