Rules: You must enter a name. You do not have to opt-in, but you really really really really should.


What is your name?
Do you want to opt in?


This simulates a JavaScript "confirm" dialog box that isn't. Instead of a JavaScript confirm, we want it to be fancier: A whole other browser window, graphics and all.

First, you need to enter a name. If not, you're flagged with an error. If you have entered a name, then you're setting for optin is analyzed. By default, the opt-in box is unchecked. However, if you don't check it, we want to ensure that's what you meant (hey I just work here). A dialog box pops up to ensure that you definitely want to not opt in.

You only have two choices: Closing the window (indicates "false"), and clicking the ok-i'll-opt-in link (indicates true). Either option closes the pop-up, and submits the form.

I've tried to capture every possible way of making this dialog box from losing focus. This is not the most solid solution:

I don't know if a truly solid solution exists.