Forum Academy Marketplace Showcase Pricing Features

"Refresh" a Captcha without refreshing the page

After the data is entered I would like the Captcha to “uncheck” itself. Is it possible?

I found this on google website, I don’t know if is i possible to use it and integrate with the bubble recaptcha plugin.

We recommend using the grecaptcha.reset() javascript function to reset the reCAPTCHA widget.

thanks!

1 Like

Did you try using reset inputs in the workflow?

Yes I also tried to put the recaptcha in a group and resetting the group but nope…

It’s odd that with this element in conditions you can’t control it’s check setting only if it’s visible or not.
To me that indicates you have no control over re-setting it’s state beyond reloading the page.

The one workaround I would try is using it an a popup - you enter your data and check the recaptcha dialog in the popup and submit. When you enter a new one the popup should automatically reset everything and let you stay on the same page - not sure if it will work.

ok thanks… no way to send to the element this grecaptcha.reset() javascript function?

Maybe - I don’t know enough about that function.

1 Like

Doesn’t it defeat the purpose? If not, use a less sophisticated captcha or roll your own and run it randomly. personally I wouldn’t try to spoof Google, especially in a shared hosting environment.

More important, what security measures does bubble have in place for (bot) attacks in the wild? Is there security insurance? Would we be covered?

The same user makes many data entry in a row on the same page , he validates the captcha first time… and then? I want him to validate for any entry, that’s why I need to reset and restore the captcha to use it again on the same page.

otherwise a human would be able to sblock the captcha the firt time and then leave the job to a robot to produce a million entries… that’s what I want to avoid btw

the code I talked about is provided by google, just need to apply it to our environment where the captcha is provided by the bubble plugin…

The challenging part is getting the javascript function to run just when you want it to, and not any other time. Here is one way to do it.

1: Create a HTML element with the javascript in it (see screenshot for indenting):

<script type="text/javascript"> if("mycustomstate" === "yes") { if(typeof grecaptcha !== 'undefined' && grecaptcha && grecaptcha.reset) { grecaptcha.reset(); } } </script>

This script will run at page load, so it has a check on the grecaptcha reset function being defined. It has another check which is explained later.

2: Create a yes/no custom state, use a workflow action to set it to “yes”, delay a bit to allow the javascript to run, then set it back to “no”. I picked 100ms delay.

3: Back to the HTML element, replace the mycustomstate with a dynamic value.

becomes:

What happens is, whenever the custom state changes value, the entire javascript is rerun, but the reset function only runs if the value changes to “yes”.

For a more robust method, you could store the current time ms in the custom state instead, and get the javascript to compare it to the last time it received a reset request.

Edit: You’ll find that the HTML element has to be “visible” for the javascript to run, but there are other ways of hiding it from display.

2 Likes

thank you! I will work on that :slight_smile:

This topic was automatically closed after 70 days. New replies are no longer allowed.