10

I would like to capture a click event on Google reCAPTCHA like below.

Google reCAPTCHA robot checkbox image

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.

Towkir
  • 3,889
  • 2
  • 22
  • 41
abu abu
  • 6,599
  • 19
  • 74
  • 131
  • 2
    You simply should not do that..... that is the whole purpose of having a captcha – Arun P Johny Oct 12 '15 at 09:24
  • @ArunPJohny Thanks for your reply. How can I do that ?? How can I detect user click on the captcha checkbox ?? – abu abu Oct 12 '15 at 09: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 complex extra hidden events working in the background. I'm guessing maybe it requires some mouseenter and mousemove events before clicking etc... – Noldor Oct 12 '15 at 09: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 –  Sep 13 '18 at 17:19
  • https://stackoverflow.com/questions/31687803/recaptcha-v2-client-side-events/31689541 –  Sep 13 '18 at 17:20
  • 1
    Possible duplicate of [ReCaptcha v2 client side events](https://stackoverflow.com/questions/31687803/recaptcha-v2-client-side-events) –  Sep 13 '18 at 17:20
  • @SundeepPidugu, I asked this question 2 years ago. Thanks. – abu abu Sep 14 '18 at 12:19
  • Ohk if you think that answers ur question please write the answer to the question and mark it as answered. –  Sep 14 '18 at 14:09
  • @SundeepPidugu, I left the question. Thanks. – abu abu Sep 14 '18 at 15:34

1 Answers1

3

You 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