A
Alistair Potts
I'm assigning the onbeforeunload event a function thus (pseudo code):
window.onbeforeunload=checkForm;
function checkForm() {
if(formChanged){ return 'You changed the form, are you sure?' }
}
As a conditional unload it works fine - the prompt only appears if you
have changed form values. The issue is that Firefox/Mozilla comes up
with a warning - "function checkForm does not always return a value".
This is really annoying me - I wondered if anyone had a workaround. If
you return anything else (null, false etc.) you get the prompt.
AJP
window.onbeforeunload=checkForm;
function checkForm() {
if(formChanged){ return 'You changed the form, are you sure?' }
}
As a conditional unload it works fine - the prompt only appears if you
have changed form values. The issue is that Firefox/Mozilla comes up
with a warning - "function checkForm does not always return a value".
This is really annoying me - I wondered if anyone had a workaround. If
you return anything else (null, false etc.) you get the prompt.
AJP