Need help with onbeforeunload function
Hi, I have the following code which acts as desired to a point.
<script type="text/javascript">
window.onbeforeunload = function() {
return "Using the browsers back, refresh or close button will cause you to lose all form data. Please use the Next and Back buttons on the form";
}
</script>
I need this to allow the submit button to submit w/o popping the confirm dialog. How would I add a var ie
var okToSubmit and apply it to the function as if(!okToSubmit) return and set it to true on the submit button? everything Im trying isn't working!