Prompting user when form fields have changed and they do not save
<p>Pretty common scenario here, a user changes fields in a form and leaves the page without saving. I throw a warning message.</p>

<p>I first began with using </p>

<pre><code>$(window).bind("beforeunload", function(){ });
</code></pre>

<p>But I want to throw a Dialog and give the user some options, I opted for this instead. </p>

<pre><code>$("#myForm").change( function(){
    $("a:not(:#myForm a)").click( function(){
    $("#promptDialog").dialog("open");
        return false;
    });
});
</code></pre>

<p>The only scenario in which this doesn't accurately work is when the user changes a field, then changes it back to it's original value (It shouldn't prompt, but does).</p>

<p>Is this solution elegant, is there a better way to do this?</p>
