posted 17 years ago
Hi everyone
I have a data grid and 2 buttons on a page, when a user cancels the window, i want to displat a popup asking the whethere they are sure they want to cancel.
i currently have
<SCRIPT>
function SaveChanges()
{
event.returnValue = "You will loose all unsaved changes, please update details before closing the window.";
}
</SCRIPT>
i call this function on the body like
<body bgColor="#ffffff" MS_POSITIONING="GridLayout" onbeforeunload="SaveChanges()">
Problem is, this message comes up even when clicking the buttons on the page, which is wrong, i want it to happen only when the user closes/cancels the window. Please help