Prompt for save onunload unless...
Posted on 2006-04-18
I want users to be prompted for save onunload unless they click a certain link called Load Address.
The code below works perfectly for prompting the user when they close or leave the page.
I thought I could set a variable onload in the body tag and then condition the confirm prompt on the value of the variable. I would then change the variable's value if they clicked the Load Address link and then they would not be prompted. My idea doesn't work at all.
I got this code from a post by hensen in Q_20451277: