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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -