You are not logged in.
Hi there,
I am trying to add a confirm dialog box when user attempt to close browser, and show a message to the user that changes might not have been saved.
So I tried to add a onBeforeUnload event to the <body> of the HTML. However, because "save" in Xinha is actually reloading the form, the event is being launched when the user is saving the content rather than exit browser.
Also attempted to hook in as a plug in, and same effect.
I saw the "SaveSubmit" plugin actually can detect changes and change the icon to a save button with "red" indicator. Perhaps I should review and add more code to the SaveSubmit plugin and add the hook to listen to onBeforeUnload?
So anyone has tried to launch a confirm dialog before exit browser?
Thanks in advance.
Cheers,
Calebmei
Offline
I wouldn't have thought Xinha would mess with an onunload event. That said. I vaguely recall that onunload when actually closing a window doesn't work.
Maybe that's old knowledge though.
James Sleeman
Offline