title: How can I submit form on button click when using preventDefault()?
body: <p>I'm using jQuery's <code>.preventDefault()</code> to prevent form submit when users clicks the [ENTER] key. The problem is that it also stops the form submitting when I click the submit button.</p>
  
  <p>I see there are many threads on Stackoverflow in regards of <code>.preventDefault()</code>, but none of them addresses my problem.</p>
  
  <p>Here's the code I'm currently working on.</p>
  
  <pre><code>// Part of my form
  &lt;form id="subscription_order_form" class=""  method="post" action="some_url"&gt; 
    &lt;button id="btn_order" type="submit"&gt;Order&lt;/button&gt;
  &lt;/form&gt;
  
  // Prevent the form to be submitted on ENTER
  $('#subscription_order_form').submit(function(e){
    e.preventDefault();
  });
  
  // Controll data
  $('#btn_order').click(function(){
    checkMandatoryFields();
  });
  
  
  // Check mandatory fields before subitting:
  function checkMandatoryFields(e){
  
    // Code for testing here
  
    // Set "error" message and abort submission
    if(msg.length &gt; 0) {
      // Do something
    } else {
  
      //submit or trigger is not recognized as functions
      $('#subscription_order_form').submit(); //.trigger('submit');
  
    }
  }
  </code></pre>
  
  <p>Can anyone please tell my what he code for submitting the form on button click is?</p>