I am writing code that allows users to display a list of available part numbers and lets them reserve them by checking the boxes and submitting. To prevent multiple people in the app from reserving the same parts, I have a lock flag I put on the file. While the list is displayed, the flag is set to 1. If the user leaves the page without submitting the form I want to reset that flag to 0 - this is done in a separate page which I use for timeouts as well.
I'm using the onUnload event on the body tag. All the users are on IE5+. This code works fine from many machines (even my IE6 SP1) but not for one user with IE5.5 SP1. He has javascript enabled. There "should" not be a google toolbar or any popup blocker software installed. Any other possible solutions? Is there a better way to write this code?
body tag code:
onUnload="unLockEMS('close')"
function:
function unLockEMS(sType){
//if the hStartNo is not blank, form is being resubmitted so keep EMS locked
//if hStartNo is blank, then unlock EMS
if (document.SpecStart.hStartNo.value.length ==0) {
var page = "include/ems_timeout.asp?iSeq=" + iSeq;
var windowprops = "width=100,height=100,location=no,menubar=no,toolbar=no,scrollbars=no,resizable=no";
newWindow = window.open(page,'PopupName',windowprops);
newWindow.blur();
window.focus();
if (sType != 'close') {
alert("Session terminated due to inactivity.");
location.href = "request.asp";
}
}
}
I'm using the onUnload event on the body tag. All the users are on IE5+. This code works fine from many machines (even my IE6 SP1) but not for one user with IE5.5 SP1. He has javascript enabled. There "should" not be a google toolbar or any popup blocker software installed. Any other possible solutions? Is there a better way to write this code?
body tag code:
onUnload="unLockEMS('close')"
function:
function unLockEMS(sType){
//if the hStartNo is not blank, form is being resubmitted so keep EMS locked
//if hStartNo is blank, then unlock EMS
if (document.SpecStart.hStartNo.value.length ==0) {
var page = "include/ems_timeout.asp?iSeq=" + iSeq;
var windowprops = "width=100,height=100,location=no,menubar=no,toolbar=no,scrollbars=no,resizable=no";
newWindow = window.open(page,'PopupName',windowprops);
newWindow.blur();
window.focus();
if (sType != 'close') {
alert("Session terminated due to inactivity.");
location.href = "request.asp";
}
}
}