- function doClose() {
- if (formHasChanged) {
- if (confirm('You are now leaving the page and any data you have entered will be lost.\nDo you want to proceed?\nClick Ok if you wish to save and continue or click Cancel to lose your unsaved changes.')) {
- Fbyid("saveButton").click();
- }
- else { return false; }
- }
- return true;
- }
- window.onbeforeunload = function() { doClose() }