Results 1 to 8 of 8
Thread: Conditional BeforeUnload
Oct 28, 2003, 04:25 #1
- Join Date
- Oct 2003
- England, Wiltshire
- 0 Post(s)
- 0 Thread(s)
?Hi is there anyway to make a before unload event dynamic based on a flag..
Essentially, I would like the user to be prompted that application has not been completed on back, close etc. I however do not want the user to be prompted if they have completed the application.
I have a function on submit where I plan to set the flag to true.
I would expect something like the following but it doesnt work for me?
mess = "Leaving this page without submitting the application form will clear DOB entries. Do you wish to leave the application form?"
window.onbeforeunload = (on) ? unloadMess : true ;
if (flag = "N") // Application form has not been submitted.