K
Kathy Burke
I have a multiple page FRAME in asp.net in a tightly controlled intranet
app. If the user clicks the X close window/browser button, I simply want
to check that a certain Session variable equals something; if it does,
give the user a confirm box (javascript) that closing the window will
cause data loss; hitting OK processes the close.
I've found the javascript for the hmtl section, but it first sets a flag
variable (properExit) to false". Depending on my session variable, how
do I set the flag variable to true, to bypass the confirmExit function?
SCRIPT:
<script language="javascript">
var properExit = "false";
function confirmExit() {
if (properExit != "true") {
return "Closing the browser will cause loss of data.
To continue, click OK, to return to the form click
Cancel.";
}
}
</script>
<BODY....onBeforeUnload='return confirmExit();' />
Thanks.
Kathy
app. If the user clicks the X close window/browser button, I simply want
to check that a certain Session variable equals something; if it does,
give the user a confirm box (javascript) that closing the window will
cause data loss; hitting OK processes the close.
I've found the javascript for the hmtl section, but it first sets a flag
variable (properExit) to false". Depending on my session variable, how
do I set the flag variable to true, to bypass the confirmExit function?
SCRIPT:
<script language="javascript">
var properExit = "false";
function confirmExit() {
if (properExit != "true") {
return "Closing the browser will cause loss of data.
To continue, click OK, to return to the form click
Cancel.";
}
}
</script>
<BODY....onBeforeUnload='return confirmExit();' />
Thanks.
Kathy