Google Captcha and posted positive validation

I have set Multiform Recaptcha. How to validate Google variable as positive that content cannot be posted?

Can be improved this code as there are two captcha designs and need to pass variables into PHP variable like
$smarty->assign(“gcaptcha”, $gcatcha);

How to receive POST value in this case ($gcatcha)?

Need help

<!DOCTYPE HTML>

<html>

<head>
  <title>gCaptcha and Multiforms design</title>
</head>

<body>
<form id="mycontactform1" method="post">

<script>

function IsRecapchaValid()
{
  var res = grecaptcha.getResponse(form);
  if (res == "" || res == undefined || res.length == 0)
  {
    return false;
  }
  return true;
}

var recaptcha1;
var recaptcha2;
var myCallBack = function() {
  recaptcha1 = grecaptcha.render('recaptcha1',
    {
    'sitekey': 'XXX',
    'theme': 'light'
    }
  );

  recaptcha2 = grecaptcha.render('recaptcha2',
    {
    'sitekey': 'XXX',
    'theme': 'dark'
    }
  );
};
</script>
<script src="https://www.google.com/recaptcha/api.js?hl=en&onload=myCallback&render=explicit" async defer></script>

<input type="submit" name="formsubmit1" data-callback="captchaSubmit" value="Send" class="" />

</form>
</body>

</html>

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.