Advice on how to prompt for saving edits
I want to pick your collective brains on how to do something:
I have a page that has about 10 fields for display/edit.
If a user edits any of the data in any way, and trys to navigate away before saving I want a message to display saying "would you like to save your edits, yes (saves), no ignores.
Is there an easy way to do this?
Re: Advice on how to prompt for saving edits
For your body tag:
onbeforeunload="RunBeforeUnload()"
Then, make a function called RunBeforeUnload() that returns true if the page should navigate away or false if it should not.
Re: Advice on how to prompt for saving edits
Or instead of true/false you can force a postback to occur if that's your thing.
Re: Advice on how to prompt for saving edits
Thanks I'll play with it.