|
|
Posted by Max on 08/11/05 06:02
I've got a dilemna that I'm hoping someone can help with.
I've got a php page that allows users to select and deselect certain objects
from an list that is in an array. The array is held in a php session because
after each select/deselect a postback is made on the page, and by keeping
the array in the session, I don't loose the data.
Anyway, I'm also using javascript onunload to detect if the user attempts to
leave the page before saving the settings (the select/deselects made). If
the user attempts to leave the page they are presented with a javascript
confirm popup box. They receive the message, "If you continue you will lose
changes, blah, blah, or you can hit cancel....". If the user clicks on
Cancel, they stay on the page, if the user clicks OK, they navigate away.
All of this works fine...for the most part.
Now the problem. If the user decided to navigate away from the page, I need
to somehow unregister the PHP session. Because I'm using client-side
javascript with confirm, I can't figure out how to do it. So all the options
that were selected on the original page, are still present in the array in
the php session.
Anybody have an idea on this?
Thanks for any help you can give.
Max
Navigation:
[Reply to this message]
|