title: ReCAPTCHA validation
body: <p>Here I have a simple form in jsp. I want both the reCAPTCHA and the textbox to be 'required' fields. Currently, if I just fill in text box and press 'Sign In', it still sends data. How do I make the reCAPTCHA required i.e. compulsory?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  
  &lt;script src='https://www.google.com/recaptcha/api.js'&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;label&gt; Form &lt;/label&gt;
  
  &lt;form action = "somefile" method = "post"&gt;
  
    &lt;input = "text" name = "textbox1" required&gt;
  
    &lt;div class="g-recaptcha" data-sitekey="6LdliBkTAAAAALmMlPRRm0NtKW3fz2kT2nxiWrVG"&gt;&lt;/div&gt;
  
    &lt;button type="submit" name="login"&gt;Sign In&lt;/button&gt;
  
  &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>