admin管理员组文章数量:1326282
I would like to capture a click event on Google reCAPTCHA like below.
I am using the below code.
jQuery('#I0_1444640729099').on('load', function() {
jQuery(".recaptcha-checkbox-checkmark").click(function() {
alert("test");
});
});
But I cannot do that. Can anyone help me in this regard?? I would like to catch the successful captcha submission event too.
I would like to capture a click event on Google reCAPTCHA like below.
I am using the below code.
jQuery('#I0_1444640729099').on('load', function() {
jQuery(".recaptcha-checkbox-checkmark").click(function() {
alert("test");
});
});
But I cannot do that. Can anyone help me in this regard?? I would like to catch the successful captcha submission event too.
Share Improve this question edited Jun 22, 2019 at 20:59 Towkir 4,0142 gold badges26 silver badges42 bronze badges asked Oct 12, 2015 at 9:23 abu abuabu abu 7,06023 gold badges82 silver badges155 bronze badges 9- 2 You simply should not do that..... that is the whole purpose of having a captcha – Arun P Johny Commented Oct 12, 2015 at 9:24
- @ArunPJohny Thanks for your reply. How can I do that ?? How can I detect user click on the captcha checkbox ?? – abu abu Commented Oct 12, 2015 at 9:26
- I'm not sure but probably you can't achieve that by a simple click call. The whole purpose of that captcha is to catch if a real user clicked it or not. So, there might be some plex extra hidden events working in the background. I'm guessing maybe it requires some mouseenter and mousemove events before clicking etc... – Noldor Commented Oct 12, 2015 at 9:29
- I dont think so you can do this as this is the whole point of using recaptcha and other verification methods so that no one can automate a particular process, YOU SIMPLY CANNOT – user3937422 Commented Sep 13, 2018 at 17:19
- 1 Possible duplicate of ReCaptcha v2 client side events – user3937422 Commented Sep 13, 2018 at 17:20
1 Answer
Reset to default 3You can add a data-callback to the DIV that Google gives you:
<div class="g-recaptcha" data-callback="recaptchaCallback" data-sitekey="RECAPTCHA_KEY"></div>
Then you add the callbak function to your code:
$("#g-recaptcha-response").on("click", function(){
alert("test"); });
I hope I've helped
本文标签: javascriptjQuery click event on Google reCAPTCHAStack Overflow
版权声明:本文标题:javascript - jQuery click event on Google reCAPTCHA - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742211690a2433829.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论