title: Submit form with button input and jQuery
body: <p>I have a form like this :  </p>
  
  <pre><code>&lt;form id="myform" action="something.php" method="post"&gt;
  &lt;input type="text" name="first_name" /&gt;&lt;br /&gt;
  &lt;input type="button" id="submit" value="Send" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I want to submit this form after getting successful message from some processes in JavaScript and jQuery. So I did it like this :  </p>
  
  <pre><code>$(document).ready(function(e) {
    $('#submit').click(function(event){
      event.preventDefault();
  
      $.post('process/process.php',
            {
                // I passed data here
            },
            function(data) {
                if (data.result == '1') {
                    $('#myform').submit();
                } else {
                    alert('Error #'+data.result+' occurred!');
                }
            },
            'json'
      );
    });
  });
  </code></pre>
  
  <p>But even after getting <code>data.result == '1'</code>, the submitting form does not work. What's the problem here ?</p>
  
  <hr>
  
  <p><strong>Edit:</strong>  </p>
  
  <p>I've changed jQuery to :  </p>
  
  <pre><code>$(document).ready(function(e) {
    $('#submit').click(function(event){
      $('#myform').submit();
    )};
  )};
  </code></pre>
  
  <p>So there is no condition now, but form did not submit.</p>