Hi,
I am using SP 2010 with infoPath 2010.
In order to prevent data loss if users of the form close the browser window, we would like to display that prompts the user to save data before closing? It would be something like “Are you sure you want to close the browser?” with <Yes> to continue closing and <No> to cancel the close and return to the application.
I have managed to include a popup on the Forms but this popup comes up every time a user navigates away from a page (this includes button clicks, tab changes etc). Of course, this is not required as all we want is the popup to appear when the user closes the browser window.
As InfoPath forms generates the form at runtime using JavaScript and there are events attached dynamically on every user action (including button clicks), I have not been able to attach an event that will separate the clicks on the Buttons from the window close. Please suggest.
Regards,
Amit