Click to See Complete Forum and Search --> : Intercepting Refresh, unload, etc.


Geat
05-12-2003, 07:24 AM
Here's the scenario:

I've got a web-based page content editor that can be used my multiple users from the same company, and thus the page has to be locked whilst in use. If the user follows the procedure exactly (i.e. selects edit, does their stuff, then presses either cancel or submit), the page is then flagged as free.

The problem is, if the user presses refresh or closes the window, the page is left in limbo, still set to "in use" and so no-one can access it.

I know you can intercept the refresh or close events with the "onBeforeUnload" event, but in IE (my target browser), it comes up with some stupid dialog giving them the option to continue, even if I explicity try to return false.

Is there a way round this?