title: javascript/jQuery Double Submit Prevention method disables initiation of html5 attributes (e.g. Required, Pattern, etc.)
body: <p>The javascript/jQuery double submit prevention method I use is this:</p>
  
  <pre><code>$("#btnsubmit").click(function () {
      $("#btnsubmit").attr('disabled','disabled');
      $('#postform').submit();
  });
  </code></pre>
  
  <p>So on submit <code>click</code>, the <code>Submit Button</code> is <code>disabled</code> and the form is submit. So double submit of the form will not happen. BUT. The problem now is that the html5 attributes will not initiate (e.g. Required, Pattern, etc.)</p>
  
  <p>Does anyone have any ideas on how to fix this?</p>
  
  <p>or maybe you can suggest alternative double submit prevention method that will not tamper with the html5 attributes?</p>
  
  <p>EDIT + DANIEL PATZ ANSWER:</p>
  
  <pre><code>$('#postform').on('submit', function (e) {
      // THIS PART
      var titleLength = $("#title").val().length;
      var descriptionLength = $("#description").val().length;
      if(titleLength &lt; 20 || descriptionLength &lt; 150) {
          $("#ps").text("Title and Desc Problem.");
      } else {
      // UNTIL HERE
          $('[type="submit"]').prop('disabled','disabled');
      }
  });
  </code></pre>