My first post here so please be gentle!
I have a web based application that needs to run some background database code when the browser (Internet Explorer) is closed. I do this by using OnUnload that then submits a form. 99% of the time this works, but I have found a couple of PCs where the form isn’t submitted. I know that the OnUnload function is being used (by adding alerts), but can’t work out why the form isn’t being submitted. The onUnload function I use is:
function handleClose ()
{
with ( top.head.frmTimeout )
{
MGWLPN.value = ‘Server1;
MGWCHD.value = ‘2p’;
SESID.value = ”;
PROG.value = ‘TIMEOUT’;
MOD.value = ”;
TAG.value = ”;
TGT.value = ”;
EVAL.value = ”;
submit();
the form is:
<form name=’frmTimeout’ method=’POST’ action=’/scripts/mgwms32.dll’>
<input type=’hidden’ name=’MGWLPN’ size=” value=”>
<input type=’hidden’ name=’MGWCHD’ size=” value=”>
<input type=’hidden’ name=’SESID’ size=” value=”>
<input type=’hidden’ name=’PROG’ size=” value=”>
<input type=’hidden’ name=’MOD’ size=” value=”>
<input type=’hidden’ name=’TAG’ size=” value=”>
<input type=’hidden’ name=’TGT’ size=” value=”>
<input type=’hidden’ name=’EVAL’ size=” value=”>
If I submit the variables manually via the address bar it works fine.
Can anyone think of any reason why I’m having this problem, or think of another way of doing it?
Many thanks
Stuart