How to "discard" form changes?
<p><strong>Setup:</strong></p>

<p>I have a form and a "Submit" button. Ideally the user should fill out the form, click "Submit" and then leave the tab. If he tries to leave the tab without saving the changes, I need to alert him with 3 options:</p>

<ol>
<li>Save</li>
<li>Discard: discard the form data changes, and leave the tab, as if the data was never modified. If user comes back to the same tab, he should see the "unmodified" data.</li>
<li>Cancel: Just dismiss the dialog box, keep the user on the same tab. User can either modify the data further, click save, etc.</li>
</ol>

<p><strong>Problem:</strong></p>

<p>Implementing Save and Cancel is easy. The issue is with "Discard". If the user clicks "Discard", the form data should get restored to what it was before modification.</p>

<p>Is there any way to do this? If I haven't explained issue properly, please let me know. </p>
