I'm aware that there are many other threads related to this question, but none of them meets my need. I have a form, which I want to be auto-saved with a message on top (say Saving), when user chooses to close the browser tab without saving the form. I tried the following code:
window.onbeforeunload = function (event) {
//form saving request
event.returnValue = "The form is being saved. Please wait";
};
But, problem with above approach is:
1> I don't want it to be a alert popup, I want it to silently happen in background
2> It gives be 2 choices:- Stay on page or Leave this page, which is absurd as per my need.
Any suggestions is greatly appreciated. Thanks in advance