I'm trying to throw an alert if a user leaves a confirmation page without pressing the "place order" button. I found this code that alerts when a user leaves a page:
window.onbeforeunload = confirmExit;
return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?";
Can someone help me modify it to not alert when the place order button (id="continue) is pressed? And I have some "edit" buttons that take a user back to previous pages. Would be kind of nice if i could add urls to an array of pages that would not alert. I really don't know how to do that though!