我想将带框的Recaptcha切换到一个不带验证码的简单按钮..参见我的代码
<?php if(isset($_POST['submit'])) { ?>
INVISIBLE CONTENT... APPERS AFTER RESOLVE CAPTCHA
<?php } else { ?>
<script src='https://www.google.com/recaptcha/api.js'></script>
<form action="" method="post" onsubmit="return validar()">
<div class="g-recaptcha" data-callback="recaptchaCallback" data-sitekey="my-site-key"></div>
<button class="btn btn-primary" type="submit" name="submit">VerFilme</button>
</form>
<script>
googlerecpchk = false;
function recaptchaCallback() {
googlerecpchk = true;
};
function validar(){
console.log(googlerecpchk);
if(!googlerecpchk){
alert("reCaptcha inválido!");
return false;
}
}
</script><?php }?>