title: g-recaptcha-response with AJAX
body: <p>I've got a contact-form which sends it's information with an ajax-request to an php-script. Now I like to implement google's "i'm not a robot" recaptcha.</p>
  
  <p>The problem is, I don't know how to transport the g-recaptcha-response with ajax.
  How can I validate it and send the result to send_contactrequest_process.php?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="kontakt-container"&gt;
    &lt;form class="kontakt-form" id="kontakt-form" method="post"&gt;
      &lt;input type="text" name="firstname" id="contact-form-firstname" placeholder="Vorname (erforderlich)" class="kontakt-form-input" minlength="2" required="required" data-msg="Du musst dieses Feld ausfüllen"&gt;
      &lt;input type="text" name="lastname" id="contact-form-lastname" placeholder="Nachname (erforderlich)" class="kontakt-form-input" minlength="2" required="required" data-msg="Du musst dieses Feld ausfüllen"&gt;
      &lt;input type="tel" name="telephone" id="contact-form-telephone" placeholder="Telefonnummer" class="kontakt-form-input"&gt;
      &lt;input type="email" name="email" id="contact-form-email" placeholder="E-Mail (erforderlich)" class="kontakt-form-input" minlength="10" required="required" data-msg="Diese Email-Adresse ist ungültig"&gt;
      &lt;textarea class="kontakt-form-message" id="contact-form-message" required="required" data-msg="Was möchtest du uns mitteilen?"&gt;&lt;/textarea&gt;
      &lt;div class="g-recaptcha" data-sitekey="MY KEY"&gt;&lt;/div&gt;
      &lt;div class="kontakt-form-submit" id="kontakt-form-submit"&gt;senden&lt;/div&gt;
    &lt;/form&gt;
    &lt;p class="kontakt-form-success-message"&gt;Vielen Dank für Deine Nachricht.&lt;/p&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <pre><code>  if($("#kontakt-form").valid()){
  
          var firstname = $('#contact-form-firstname').val(); //Validierung der Form-Daten
          var lastname = $('#contact-form-lastname').val();
          var email = $('#contact-form-email').val();
          var telephone = $('#contact-form-telephone').val();
          var message = $('#contact-form-message').val();
  
          $.ajax({ //AJAX request
              type: "POST",
              url: "../../../include/process/send_contactrequest_process.php",
              data: {firstname: firstname, lastname: lastname, email:email, telephone:telephone, message:message},
              success: function () {
                  $('.kontakt-form-success-message').css( "display","inline" );
              },
          });
      }
  </code></pre>