if (XSP._isDirty()){ if (confirm ("Are you sure you want to navigate away from this page?" + "\n" + "\n" + "This document may contain unsaved changes." + "\n" + "\n" + "Press OK to continue, or Cancel to stay on the current page.")) { return true; } else { return false; } } else { return true; }