I added the recaptcha to our “contact us” form and after still receiving loads of spam, I realized the form can still be submitted without needing to tick the recaptcha box. I went through all of the information I could find on WebFlow with no luck. Any help would be appreciated, thank you.
I’m having the same issue, I added recaptcha but the form work even if i don’t click on “i’m not a robot”. I’ve tried in incognito mode and clear cache in all browsers.
If you need to add reCaptcha with a custom HTML embed, you can follow these steps. We used javascript to disable the submit button on our form if the reCaptcha loads successfully on page load. Then we use a callback function to enable the submit button when the user passes the captcha test.
Add an ID to the submit button of your form so that we can target the button in javascript. We used submitRequest. If you view source on the page, you should see the id on the submit button like below.
Add the code below to your website footer. This includes the reCaptcha script, load function that disables the button, and the enable button callback function.
<script>
function onloadCallback() {
document.getElementById("submitRequest").disabled = true;
};
function enableBtn(){
document.getElementById("submitRequest").disabled = false;
}
</script>
<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
I spoke too soon… I’m still getting spam submissions even though the forms and recaptchas are working, at least superficially. I’m lost, I may have to reset back to my less-than-ideal method of custom embed with ugly forms.
I had to use Basin form handler on an exported site but wanted to use my Webflow design. Still works well. The recaptcha id info had to be entered using Basin’s keys rather than the one generated through my own google account. This could be the case with the custom post tool you’re using.