JQuery Change() function IE problem
<p>I've got an asp.net formview control and I want the Update/Cancel buttons to be disabled until the user makes a change and I've tried using jquery to do this. The following code works in FireFox, and works in IE when the form is opened in insert mode. However, if the form is opened in edit mode (in IE), therefore getting populated when the page opens, the buttons get disabled for a split second but are then reenabled.</p>

<p>This is what im currently using.</p>

<pre><code>// Handle the document.ready event:
    $(document).ready(function() {

        // Disable the save button
        $("input.button")
            .attr("disabled", "disabled")
            .removeClass("button")
            .addClass("button-disabled");

        // Hook up event handler to enable save button when a change is made
        $("input").change(function() {
            $("input.button-disabled")
                .removeAttr("disabled")
                .removeClass("button-disabled")
                .addClass("button");
        });
        // Hook up the cancel confirmation dialog
        $(".cancelEdit").click(function() {
            showCancelConfirmation($(this));
            return false;
        });
    })
</code></pre>

<p>I changed the enable event handler code to</p>

<pre><code>$("input").bind("keypress", function() {
            $("input.button-disabled")
                .removeAttr("disabled")
                .removeClass("button-disabled")
                .addClass("button");
        });
</code></pre>

<p>which solved the problem momentarily, as the buttons are disabled until the user inputs some text. The problem I have with this method though is that the buttons are not enabled if the user deletes some text (IE only again), and I am also using the AJAX Toolkit calendar and the buttons are not enabled when a date is changed using it. </p>

<p>I know I can use the 'click' keyword in the function to enable the buttons as soon as a field is clicked, but this doesnt help with the ajax calendar input problem.</p>

<p>Any ideas on how I can solve this problem?</p>

<p>Thanks in advance</p>
