I have a page which has a grid and the possibility to edit records of this grid via forms. Now if the user tries to close the form I already check if it is dirty and ask if the user wants to save the changes. But now there is the possibility to navigate to a new href and I was wondering if there is an event (onbeforeunload?) I could bind the form to, which checks if the form is dirty before allowing to navigate to the new href?
Or any other advise how to check if the form still has to be saved?