I'm now dealing with a client request to open a form when the user leave the page. Can that be done?
Asked
Active
Viewed 164 times
2 Answers
0
I think you are looking for
onbeforeunload event
An event that fires before the unload event when the page is unloaded.

rahul
- 184,426
- 49
- 232
- 263
-
While this event is well known, it will fire an event but the page will be closed and the form will not be loaded. – David Salzer Nov 04 '09 at 17:53
0
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: onbeforeunload confirmation screen customization

Community
- 1
- 1

David Salzer
- 872
- 1
- 7
- 24