我正在使用google recaptcha
。我正在使用谷歌提供的explicity
方法渲染它。
在以前的版本中有only one recaptcha
。在新版本中,我们对同一页面上的不同表单使用了multiple recaptcha
。在上一个版本中,我通过以下方式获取recaptcha的值
$("#g-recaptcha-response").val()
现在因为有multiple recaptcha
,所以我不能得到这个值。如何获得特定形式的recaptcha的值。
发布于 2016-05-09 15:38:48
不能在一个页面上多次使用相同的id属性。您可以向所有id为g-recaptcha-response
的元素添加一个泛型类,然后尝试以下代码。
$(".yourClassName").each(function(){
var currentVal = $(this).val();
console.log(currentVal);
});
https://stackoverflow.com/questions/37109597
复制相似问题