control onunload page

admin

Administrator
Staff member
Hello,
When an user leaves the page that it is by "press back button" or "quit", the event "onUnload" is called and I call a server page via a form to pass parameters and that enables me "to kill the session".
My problem is that if an user submit normally the page with "submit" and well the event "onUnload" is called before the event "onsubmit".
Any ideas.
my code :
<html>
<head>
<script language="javascript">
function send() {
document.valide.submit();
}
function destroy() {
return document.control.submit();
}
</script>
</head>
<h1>TEST</h1>
<BODY onUnload="destroy()">

<FORM NAME ="valide" ACTION = "/servlet1" METHOD = "GET" onSubmit = return envoie()>
<input type="submit" value=http://www.webdeveloper.com/forum/archive/index.php/"" name=""/>
</form>
<FORM NAME ="control" ACTION = "/servlet2" METHOD = "GET" />
</BODY>
</HTML>
 
Back
Top