I have to give the user a user-defined message when he/she moves out of the current page as whether he/she wants to save or not. If it wants to save then I should save the current form and move ahead. But if it wishes to save but some validation fails then it should give an error message for validation and stays on the current page itself. If it doesn't wants to save then I don't need to do anything.
I have tried using window.event.returnValue="" in onbeforeunload event but it doesn't allow me to give custom message and it allows only to go to the new page or stay but doesn't allow to perform action of my choice.
If anybody has some idea regarding this please help me.
Waiting for your responses....
I have tried using window.event.returnValue="" in onbeforeunload event but it doesn't allow me to give custom message and it allows only to go to the new page or stay but doesn't allow to perform action of my choice.
If anybody has some idea regarding this please help me.
Waiting for your responses....