I'm now dealing with a client request to open a form when the user leave the page. Can that be done?
A:
I think you are looking for
onbeforeunload event
An event that fires before the unload event when the page is unloaded.
rahul
2009-11-04 11:43:24
While this event is well known, it will fire an event but the page will be closed and the form will not be loaded.
yn2
2009-11-04 17:53:37
A:
It seems to be impossible to create my own form and override onbeforeunload or anything else. I guess blocking it is the right thing though..
What we did is to pop a form and use the regular onbeforeunload. if the user wants to go - he will. But if he stays - he will get the questionnaire.
You can see the issue here too: http://stackoverflow.com/questions/1335727/onbeforeunload-confirmation-screen-custumization
yn2
2010-04-24 22:21:52