title: Google Recaptcha submit with jQuery validate
body: <p>I use last version of ReCaptcha (the invisble one).</p>
  
  <p>I understood how to use it with normal forms, and Ajax forms, but I face a little problem.</p>
  
  <p>I want to use the Captcha with jQuery validate plugin, so I use :</p>
  
  <pre><code>&lt;form id="myForm" action="send.php" method="post"&gt;
      &lt;h4&gt;Your name&lt;/h4&gt;
      &lt;input type="text" name="name" required="required" /&gt;
      &lt;div id='recaptcha' class="g-recaptcha"
          data-sitekey="***************"
          data-callback="onSubmitForm"
          data-badge="bottomleft"
          data-size="invisible"&gt;&lt;/div&gt;    
  
      &lt;input type="submit" value="Send form" class="button"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And in my JS :</p>
  
  <pre><code>function onSubmitForm(data) {
      if ($("#gRecaptchaResponse").val() == '') {
          $("#gRecaptchaResponse").val(data);
      }
      $('#myForm').submit();
  }  
  
  $(function() {
      $('#myForm').validate({
          submitHandler: function(form) {
              // execute google recaptcha
              grecaptcha.execute();
  
              // test fires everytime of course ...
              console.log('Test');
          }
      });
  });
  </code></pre>
  
  <p>I understand in the Google example from official doc (<a href="https://developers.google.com/recaptcha/docs/invisible#example" rel="nofollow noreferrer">https://developers.google.com/recaptcha/docs/invisible#example</a>) they handle click on a button (not a submit button), but I want to use the submit trigger, this way, the user can press "Enter" button to submit the form.</p>
  
  <p>But right now, there is a kind of loop, jQuery validate handles form submit, and after validation, executes the callbacks wich submits the form... Then the form is never submited (to PHP action). The result is pretty weird. </p>
  
  <p>Any simple way to keep using submit trigger ?</p>