Yashwant wrote:
Dear Netscape/Javascript/Java gurus,
I am trying to submit a form onUnLoad when the user accidentally
closes the browser before clicking on a link to complete the
transaction.
On IE, this works fine.
But on Netscape or Mozzilla browsers, the form would simply not submit
when
the browser is closed.
here is the code.
<script language="JavaScript">
function CheckWindowClosed() {
document.MyForm.submit();
}
</script>
<body onLoad="FunctionHandler();" onUnload="CheckWindowClosed();">
Kindly let me know if there is any workaround or fix where I can get
this working on Netscape.
Thanks and Regards,
Yash
This is not a good way of doing things. If the user clicks on a link,
do you want to also submit the form? Chances are that when your user
presses the submit button, this handler will also fire -- redundant.
Do you really want to submit data if the user closes the browers? This
goes against usability expectations. I expect that whenever I press the
X in the upper-right corner, that my browser will close, and I will not
send anything off.
Most likely (and I have not looked into it), Netscape is not sending it
on, because it is recognizing that the user wants to close the browser.
Why would it want to navigate to a new page, if the browser is being
closed? It is counter-intuitive.
Then again, you may have a perfectly good reason for doing this, that I
cannot think of. Explinations are welcomed.
Brian