title: How do I submit a form using jQuery after AJAX validation?
body: <p>My form has one input which needs to be validated before submitting. After a successful validation I try to submit the form, but it doesn't submit.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>$(document).ready(function() {
      $("#myForm").submit(function () {
          checkInputData();
          return false;  // to prevent default submit
      });
  });
  </code></pre>
  
  <p>The validation function:</p>
  
  <pre><code>function checkInputData() {
      var id = $($("#id")).val();  // value, which needs to be validated
      $.get("check.php?id=" + id,  
          function(result){  
              if(result == 1) {  
                  //if the result is 1, need to submit
                  $("#myForm").unbind(); // to prevent recursion?
                  $("#myForm").submit(); // doesnt work
              } else {  
                  // dont submit, give some visual feedback, etc...
              }  
      });
  }
  </code></pre>
  
  <p>What am i doing wrong? Thanks.</p>