I have a form where the input fields are saved onChange
. In Firefox (5) this works even when the window is closed, but for Chrome and IE it doesn\'t and I need
I seem to be a bit late to the party and much more of a beginner than any expertise; BUT this worked for me:
window.onbeforeunload = function() {
return false;
};
I placed this as an inline script immediately after my Head and Meta elements, like this:
<script>
window.onbeforeunload = function() {
return false;
}
</script>
This page seems to me to be highly relevant to the originator's requirement (especially the sections headed window.onunload
and window.onbeforeunload
):
https://javascript.info/onload-ondomcontentloaded
Hoping this helps.