Showing posts with label unsaved. Show all posts
Showing posts with label unsaved. Show all posts

Sunday, May 20, 2012

Detecting Unsaved Changes using JavaScript


I have a requirement to implement an "Unsaved Changes" prompt in an ASP .Net application. If a user modifies controls on a web form, and attempts to navigate away before saving, a prompt should appear warning them that they have unsaved changes, and give them the option to cancel and stay on the current page. The prompt should not display if the user hasn't touched any of the controls.