validate leaving the page for unsaved changes