title: JQuery Pause Form Submit, Add Post Data, Then Submit
body: <p>I have a form where I would like to pause the submission of the form, calculate some data and add it to the post data, for retrieval in PHP.</p>
  
  <p>Does anybody know if this is possible and if so how to do it?    </p>
  
  <pre><code>$(function() {
      $('#get_pdf_form').on('submit', function(e) {
          var hashed_center_ids = JSON.parse($('#hashed_center_ids').val());
  
          var print_data = $('.print-options:checked').map(function() {
              return this.value;
          }).get();
  
          // add the two variables above as post data
  
          $(this).submit();
      });
  });
  </code></pre>