title: Google ReCAPTCHA as a Required field in a form
body: <p>I have a Help Desk PHP and I want ReCAPTCHA field set to required. This is a Row in my <code>register.php</code> file:</p>
  
  <pre><code>&lt;?php
  include("config.php");
  if (ALLOW_REGISTER &lt;&gt; "yes"){
  echo "&lt;div class=\"alert alert-info\" style=\"width: 175px;\"&gt;Registration is Closed&lt;/div&gt;";
  include("includes/footer.php");
  exit;
  }
  ?&gt;
  
  &lt;h1&gt;&lt;?php echo TITLE; ?&gt; ثبت نام&lt;/h1&gt;
  &lt;table class="&lt;?php echo $table_style_2;?&gt;" style='width: auto;'&gt;
  &lt;form action="register_action.php" method="post" class="form-horizontal"&gt;
  &lt;tr&gt;
  &lt;td&gt;نام:&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="name" id="name"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;نام کاربری:&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="login" onblur="showResult(this.value)" required&gt; &lt;span id="txtHint"&gt;&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;ایمیل:&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="email" name="email" placeholder="name@example.com"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;پسورد:&lt;/td&gt;
  &lt;td&gt;&lt;input type="password" id="password" name="password" placeholder="at least 5 characters"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;td&gt;Human Verification&lt;br&gt;&lt;/td&gt;
  &lt;td&gt;&lt;div name="captcha" id="captcha" required class="g-recaptcha" data-sitekey="6LfrTQcTAAAAAHEoysvy3bQQaOo1vm7GTbYb4YDg"&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;/table&gt;
  </code></pre>
  
  <p>But anyone can register without doing the ReCAPTCHA! Any helps to make the ReCAPTCHA Required?  and BTW before I use recaptcha in my website , I use <code>simple-php-captcha.php</code> as captcha and have <code>captcha for registration</code> in my <code>config.php</code> which is <code>yes</code></p>
  
  <hr>
  
  <p>This is some of my <code>register_action.php</code> file:</p>
  
  <pre><code>&lt;?php include("includes/session.php");?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;ثبت نام&lt;/title&gt;
  &lt;?php
  include("config.php");
  include("includes/header.php");
  include("includes/ez_sql_core.php");
  include("includes/ez_sql_mysqli.php");
  include("includes/functions.php");
  //initilize db
  $db = new ezSQL_mysqli(db_user,db_password,db_name,db_host);
  
  if (ALLOW_REGISTER &lt;&gt; "yes"){
  echo "&lt;p&gt;Registration is Closed&lt;/p&gt;";
  include("includes/footer.php");
  exit;
  }
  
  if (CAPTCHA_REGISTER == "yes"){
  $captchasession = $_SESSION['captcha']['code'];
  $captcha = $db-&gt;escape(trim($_POST['g-recaptcha-response']));
  if($captchasession &lt;&gt; $captcha) {
  echo "&lt;div class=\"alert alert-danger\" style=\"max-width: 350px;\"&gt;Invalid Captcha Code.&lt;/div&gt;";
  include("includes/footer.php");
  exit;
  }
  }
  </code></pre>