I have some javascript code to alert the user that leaving the page will lose the answers to form questions.
window.onbeforeunload = askConfirm;
function askConfirm(){
return "Your answers will be lost.";
}
I'd like to make this happen for everything BUT a form submission.
My submit button has the ID #submit and I am using the prototype framework.
So something like: if $("submit") clicked then skip function call?
I am still pretty new to JS/Prototype so I'm not exactly sure how to approach this.