title: How can I disable a button in a jQuery dialog from a function?
body: <p>I have a jQuery dialog that requires the user to enter certain information. In this form, I have a "continue" button. I would like this "continue" button to only be enabled once all the fields have content in them, else it will remain disabled.</p>
  
  <p>I wrote a function that is called everytime a field status has changed. However, I don't know how to enable and disable the dialog button from this function. What should I do?</p>
  
  <p>Oops and I forgot to mention that these buttons were created as follows:</p>
  
  <pre><code>$(function() {
    $("#dialog").dialog({
      bgiframe: true,
      height: 'auto',
      width: 700,
      show: 'clip',
      hide: 'clip',
      modal: true,
      buttons: {
        'Add to request list': function() {
          $(this).dialog('close');
          $('form').submit();
        },
        'Cancel': function() {
          $(this).dialog('close');
        }
      }
    })
  });
  </code></pre>