title: how to test Recaptcha with jQuery Validate plugin
body: <p>I am using validate jquery plugin and recaptcha for a contact form and i woudld like to know how can i check if the code in the captcha is correct before the form get submitted if not send an error message because right now validate everything but i inserted a wrong code the form get submitted anyway. Here's my code ty in advance for anyhelp</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
               var RecaptchaOptions = {
                  lang : 'en',
                  theme : 'custom',
                  custom_theme_widget: 'recaptcha_widget'
               };
              &lt;/script&gt;
  
              &lt;form id="contact" method="post" action="#"&gt;
  
                  &lt;fieldset&gt;
                      &lt;label for="name_contact"&gt;NAME&lt;/label&gt;
                      &lt;input type="text" class="input-xlarge" id="name_contact" name="name_contact" value="" placeholder="" minlength="2"&gt;
  
                      &lt;label for="email_contact"&gt;EMAIL&lt;/label&gt;
                      &lt;input type="email" class="input-xlarge" id="email_contact" name="email_contact" value="" placeholder=""&gt;
  
                      &lt;label for="telephone"&gt;CONTACT NUMBER&lt;/label&gt;
                      &lt;input type="tel" class="input-xlarge" id="telephone" name="telephone" placeholder="" value="" &gt;
  
                      &lt;label for="message"&gt;MESSAGE&lt;/label&gt;
                      &lt;textarea id="message" class="input-xlarge" name="message" placeholder="" rows="5"&gt;&lt;/textarea&gt;                  
  
                      &lt;div id="recaptcha_widget" style="display:none"&gt;
  
                          &lt;div id="recaptcha_image"&gt;&lt;/div&gt;
                          &lt;div class="recaptcha_only_if_incorrect_sol" style="color:red"&gt;Incorrect please try again&lt;/div&gt;
  
                          &lt;span class="recaptcha_only_if_image"&gt;Enter the words above:&lt;/span&gt;
                          &lt;span class="recaptcha_only_if_audio"&gt;Enter the numbers you hear:&lt;/span&gt;
  
                          &lt;input type="text" id="recaptcha_response_field" name="recaptcha_response_field" /&gt;
  
                          &lt;div&gt;&lt;a href="javascript:Recaptcha.reload()"&gt;Get another CAPTCHA&lt;/a&gt;&lt;/div&gt;
                          &lt;div class="recaptcha_only_if_image"&gt;&lt;a href="javascript:Recaptcha.switch_type('audio')"&gt;Get an audio CAPTCHA&lt;/a&gt;&lt;/div&gt;
                          &lt;div class="recaptcha_only_if_audio"&gt;&lt;a href="javascript:Recaptcha.switch_type('image')"&gt;Get an image CAPTCHA&lt;/a&gt;&lt;/div&gt;
  
                          &lt;div&gt;&lt;a href="javascript:Recaptcha.showhelp()"&gt;Help&lt;/a&gt;&lt;/div&gt;
  
                      &lt;/div&gt;
  
                      &lt;script type="text/javascript"
                          src="http://www.google.com/recaptcha/api/challenge?k=6Lf8RN4SAAAAAKnllVnDw23UpBIuAIdTRFgN1kmX"&gt;
                      &lt;/script&gt;
  
                      &lt;noscript&gt;
                          &lt;iframe src="http://www.google.com/recaptcha/api/noscript?k=6Lf8RN4SAAAAAKnllVnDw23UpBIuAIdTRFgN1kmX" height="300" width="500" frameborder="0"&gt;&lt;/iframe&gt;&lt;br&gt;
                          &lt;textarea name="recaptcha_challenge_field" rows="3" cols="40"&gt;&lt;/textarea&gt;
                          &lt;input type="hidden" name="recaptcha_response_field" value="manual_challenge"&gt;
                      &lt;/noscript&gt;             
  
                      &lt;button type="submit" value="" id="" name="send" class="pull-right lightblue btn-primary"&gt;SUBMIT&lt;/button&gt;
                      &lt;/fieldset&gt;
  &lt;/form&gt;
  
  
  &lt;script type="text/javascript"&gt;
      $(document).ready(function () {
  
          $("#contact").validate({
              rules: {
                  "name_contact": {
                      required: true,
                      minlength: 3
                  },
                  "email_contact":{
                      required: true
                  },
                  "message":{
                      required:true
                  },
                  "recaptcha_response_field":{
                      required:true
                  }
  
              },
              messages: {
                  "name_contact": {
                      required: "Please, enter a name"
                  },
                  "email_contact":{
                      required: "Enter a valid email"
                  },
                  "message":{
                      required: "Please provide a comment"
                  },
                  "recaptcha_response_field":{
                      required: "Captcha is required"
                  }
              },
              errorPlacement: function(error, element) {
                  error.insertBefore(element);
              }
          });
  
      });
  &lt;/script&gt;
  </code></pre>