Pop up that can't be closed using browser close button

I have googled this to death and understand that the browser close button cannot be disabled via javascript.  I also know that this is not a good idea in most cases, however I am developing a web-based front end for a database using coldfusion that requires this ... or another solution I haven't thought of.  This is not for public use, but rather for a small group of in house users.  I could simply tell them "don't close the browser using the red X", but I have experience with these users and they will forget ... things have to be more bullet proof for them.

I am creating a 7 step wizard with a form for each step.  The user must either complete the 7 steps, or click the close button I have added to the pop up (onclick = window.open....), otherwise my cookie management fails and causes all kinds of problems.

At first I thought I could do a simple "onunload=window.opener.location.replace ..." but I encountered a problem.  To explain, when the form on each step is submitted, it the page technically is "unloading" and the JS script runs, which removes some cookies, causeing problems.

I read many times to add fullscreen=yes to the 'window.open' which is supposed to hide the tool bar, but that does not appear to work ...

... the only thing I can think of is to either disable or hide the browser close button or start over and create some sort of modal popup (which I don't really want to have to do as I am way behind on this project as it is)

Max
LVL 1
MaxwellTurnerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AngryBinaryCommented:
I'm afraid you are genuinely out of luck. If the design of your application absolutely depends on nobody closing their browser using the browser close button, then you should re-evaluate the design (I mean, are the long-term training prospects even feasible?)

What you ought to be looking for is a way to make your application "state-less" - in other words, nothing is committed until all steps are completed, so if the user bails out suddenly in the middle of the process, no information is left in an invalid state. How that can be done will require a little more exploration into the process - I'm sure you can think of some reasons why that would be difficult, so articulate those and we can work around them.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
COBOLdinosaurCommented:
Instead of a popup use an absolutely positioned div that sits on top and populate it using AJAX.  They can't close the div unless they close the whole page; something you would never be able to control.


Cd&
0
MaxwellTurnerAuthor Commented:
Thanks AngryBinary,  

I liked your 'stateless' recommendation and decided to take your advice.  I only have 23 variables, so I'm just passing the variables as they accumulate in hidden [input]'s  It is fairly simple (except for a couple contingencies where the user jumps back a few steps ... makes for a loong urls!), but I have it working mostly, just need some tweaks.  This method also solves some other issues that are no longer issues ,so thanks!  Wish I had decided this from the start ... C'est la vie!

Max
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.