/    Sign up×
Community /Pin to ProfileBookmark

Form Submission with OnUnload

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

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@CharlesJul 17.2003 — [font=georgia]Include a submit button and then do your scripting "onsubmit".[/font]
×

Success!

Help @s7uar7 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...