javascript - Alert user for unsaved changes in page within panels using jquery -
i have situation here, need stop user if user has left unsaved changes on page.
i got information on internet moving current page other page like
var warnmessage= "you have unsaved changes"; $('input:not(:button,:submit),textarea,select').change(function () { window.onbeforeunload = function () { if (warnmessage != null) return warnmessage; }; }); $('input:submit').click(function(e) { warnmessage = null; });
this works fine when closing tab or url getting changed.
i have panels on page 3 different panels;each submit, cancel , reset. now, need alert user when happens open panel; last panel has unsaved changes user should alerted
if he/she has unsaved changes on panel, submit/reset/cancel button clicked should confirm user.
is possible?
Comments
Post a Comment