只要用户勾选并验证Google recaptcha,我有兴趣隐藏resultcaptcha消息。只有第一部分(v.length == 0)有效。其他如果不起作用。你可以在这里检查的形式:https://csandreas1.herokuapp.comGoogle recaptcha使用Jquery验证
if(grecaptcha.getResponse() == 0) // this works
{
$('#resultcaptcha').show();
$('#resultcaptcha').html('<i class="fa fa-exclamation-circle w3-text-red fa-3x" aria-hidden="true"></i> <span class="w3-text-white w3-bold" style="font-size:16px"> Please verify that you are a human</span>');
}
else if(grecaptcha.getResponse() == 1)//this doesn't work
{
$('#resultcaptcha').hide();
$('#resultcaptcha').html('');
}
else{//submit the form}
尝试'v.length> 1'作为响应是一个令牌ID长度大于1个 –
没了时,不工作 –
登录应对控制台和实际检查什么包含的内容。 – CBroe