错误消息
我们检测到您的站点未验证 reCAPTCHA 解决方案。这是在您的网站上正确使用 reCAPTCHA 所必需的。请查看我们的开发者网站了解更多信息。
我创建了这个 reCaptcha 代码,它运行良好,但我不知道如何验证它,我认为它正在使用函数进行验证,
grecaptcha.getResponse();
但事实并非如此。显然,recaptcha 在网站上运行良好,但我刚刚在 Google 管理员中看到了下一条消息:
要求:
1.不要在表单中使用action="file.php"
,表单中只有一个javascript函数。
<!DOCTYPE>
<html>
<head >
<title></title>
<script src='https://www.google.com/recaptcha/api.js'></script>
<script type="text/javascript">
function get_action() {
var v = grecaptcha.getResponse();
console.log("Resp" + v );
if (v == '') {
document.getElementById('captcha').innerHTML = "You can't leave Captcha Code empty";
return false;
}
else {
document.getElementById('captcha').innerHTML = "Captcha completed";
return true;
}
}
</script>
</head>
<body>
<form id="form1" onsubmit="return get_action();">
<div>
<div class="g-recaptcha" data-sitekey="6LdNIlAUAAAAADS_uVMUayu5Z8C0tw_jspdntbYl"></div>
</div>
<input type="submit" value="Button" />
<div id="captcha"></div>
</form>
</body>
</html>
请你帮帮我。我会很感激我如何验证它,因为我需要使用javascript函数onsubmit="return get_action();"
而不是action="file.php"
*当我提交时?: