I have a jQuery function set a hidden field value when changes are made to a textbox in an editable GridView. There are two buttons on the form; one to save changes and another to use the new values to execute a different process. I would like a confirmation to appear if the second button is pressed first, telling the user that the changes were not saved. Clicking "Yes" will save the changes and run the process for that button. Click "No" does nothing. I cannot use "return confirm('')" because that would show a confirmation all the time, even if not changes are detected. The confirmation should only show up if the hidden field has a value (in this case, "changed"). I've tried various solutions but get errors about functions not existing or other null objects.

**The following detects changes and sets the hidden field value to "changed":**

```
$(function () {
    $(".gv input.CAIFormat").bind('blur', function (e) {
         $(this).val(CommaFormatted($(this).val()));
         var change = $get('ctl00_BodyContentPlaceHolder_TabContainer1_tabSpaceDriver_hidSummaryTableChanged');
         change.value = "changed";
    });
});

```

**The asp.net button should show a confirmation if the hidden field has a value:**

```
<asp:Button ID="btnSaveSDDepartmet" runat="server" Text="Update Departments" />

```