title: Disabled button still submits form
body: <p>The save button gets disabled after you click it once, but if you click it again, it resubmits the form. I am guessing it never reaches the first part of the if statement. Any help would be appreciated:</p>
  
  <pre><code>-block extra_scripts
  
  :javascript
  
    function check_button(){ 
      var saveButtons = $('a[name=saveButton]');
      if (saveButtons.is(':disabled')) { 
        alert("disabled");
        return false;
      }
      else{
        $("#main_form").submit();
        saveButtons.attr("disabled", true);
      }
    }
  
  -block main
  
    .btn-group.pull-right
      %a.btn.icon-save.btn-callout{
        :name =&gt; "saveButton",
        :id =&gt; "saveButton",
        :type =&gt; "submit",
        :onclick =&gt; "check_button()"
        }
        Save
  </code></pre>
  
  <p>Just a note, saveButtons contains two buttons. One for the top of the page, and one for the bottom.</p>