Javascript, onbeforeload event works when submitting on a form in IE
<p>I am writing for some adivce on a javascript I made for a xhtml page. I got it to mostly work on IE, FF and chrome (Safari still giving me some grief but thats another subject.) The problem I am having is that IE would run the beforeunload event even when someone is submitting a form which is not something i want to happen because the beforeunload script would cause the information to be reseted. It even does it when I press F5 which isn't something I want either. Now FF and Chrome aren't having that problem when the form is submitted don't know why though. Here is the code I have written so far. </p>

<pre><code>&lt;script type="text/javascript"&gt; 
window.onbeforeunload = function() {
var hiddenBtn = document.getElementById("kioskform:broswerCloseSubmit");
return  hiddenBtn.click();
           }   &lt;/script&gt;
</code></pre>

<p>Just wondering how to go about this any advice is very appreciated thank you. </p>
