I am trying to have a confirm box come up when the viewer tries to close the window, that allows the user to stay on the current page (by click Cancel), or continue closing the window (by click OK).
My code is as follows...
<script>
function confirm_exit(){
var message = window.confirm("My message.");
if (message == true) {
// Output when OK is clicked
window.close();
} else {
// Output when CANCEL is clicked
???????
}
}
</script>
I am not sure because either one I click closes the window. I need Cancel to remain at the current page, and OK to close the window or proceed with the users window.event.
Hope this makes sense.