Hello All,
Here I have one web page like create. suddenly if i click on other tab need to show warining message like are sure want to leave
this is my code:
window.addEventListener("beforeunload", function (e) {
var confirmationMessage = 'It looks like you have been editing something.';
confirmationMessage += 'If you leave before saving, your changes will be lost.';
(e || window.event).returnValue = confirmationMessage;
return confirmationMessage;
});
But my problem if i fill all fields and submit i got error message for above code. i Need to get warning message only if i click other page or other tab
Please help...
Thanks in advance

Upendra Pratap ShahiRank #329 · 7.5K reputationPosted May 25, 2015, 9:06 PM EDT
Hari B129 reputationPosted May 25, 2015, 9:23 PM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted May 25, 2015, 9:26 PM EDT