I'm already using the onbeforeunload event, if the user decides to stay on the page then I will not unlock the records:
Code:
<body onUnload="unlockrecord();" onbeforeunload="setmess();">
<script language="javascript">
function unlockrecord()
{
window.onbeforeunload = null;
window.onunload = null;
document.editreport.action="unblock.php";
Leave a comment: