Hello Folks!
I'm currently stuck in a confusing situation.
On a page there is a form - if the user changed something but instead of submitting the form he leaves the page - i have to prompt him and ask for save.
so far it's easy.
but if I prompt him using <body onunload="xxx"> then the site where he wants to go will get a request. the problem is: if he requests "New Entry" - this site will be loaded. Not really loaded, because <body onunload="xxx"> stops the browser from showing this site, but the PHP script get invoked.
The problem is: this PHP script can delete all entries the user is currently editing.
so i have to stop the script from beeing invoked.
any suggestions?
i know this is hard, and i'm working on it for a several hours but maybe you can help me.
I'm currently stuck in a confusing situation.
On a page there is a form - if the user changed something but instead of submitting the form he leaves the page - i have to prompt him and ask for save.
so far it's easy.
but if I prompt him using <body onunload="xxx"> then the site where he wants to go will get a request. the problem is: if he requests "New Entry" - this site will be loaded. Not really loaded, because <body onunload="xxx"> stops the browser from showing this site, but the PHP script get invoked.
The problem is: this PHP script can delete all entries the user is currently editing.
so i have to stop the script from beeing invoked.
any suggestions?
i know this is hard, and i'm working on it for a several hours but maybe you can help me.