As soon as you planned to use modal dialog, the advice by Wonde would work just fine for you.
I only want to note that any kind of modal behavior would be somewhat annoying the the user, who mostly would prefer just to stay on a single page and not distracted by any other window until she or he decides to navigate away. So, you really might want to use a check box.
In this case, you need to use
checkbox.checked
. Also, comparison with
null
makes no sense; you just need to write
"if (checkbox.checked)"
. You can find a sample of whole thing in my previous solution:
HTML Forms with JavaScript[
^].
Good luck,
—SA