View Full Version : using onunload if form page not submitted

06-13-2004, 09:47 PM
How can I code so that I can show a PopUp or alert ( using onunload or something similar ) only if the user did not submit a form, but tried to leave my site. Can this all be handled in javascript or must some server side programming be executed. Code samples welcomed.

06-13-2004, 10:19 PM
You need to use a flag (variable) to keep the function from performing.

When you use a form, you need to change the flag do the function does not fire.