However, I only see where to put the sitekey and not the secret key ?
Any idea ?
The reason I’m asking is because I need to setup a callback on the recaptcha itself, so that when the recaptcha is checked, the submit button is enable again…
quick question, I figured out I could actually set a data attribute to the native Webflow recaptcha element.
The recaptcha data attribute looks like this in Webflow: data-callback="enableBtn"
The submitt button id attribute looks like this in Webflow: id="btnLock"
The javascript code looks like this Webflow:
// initially disable the submit button
document.getElementById("btnLock").disabled = true;
// callback enabling submit button on recaptcha successful
function enableBtn() {
document.getElementById("btnLock").disabled = false;
}
Both the recaptcha and button attribute can be seen when inspecting the source code of the page, unfortunately, the submitt button isn’t disabled on page load as it should be (as per the javascript snipet)
EDIT:
It seems, the code works as expected when the submit button isn’t in the form component… as soon as I put the submitt button inside the form element, its behaviour is enabled despite the javascript supposingly disabling it…
I successfully pushed a script to the Webflow wrapper so that the submit button gets disabled on DOM ready. I Successfully explicitly rendered a reCAPTCHA with custom code. This reCAPTCHA successfully triggers the callback which is supposed to enable again the submit button… but it doesn’t ! I know the callback is being called since I put an alert message in my callback and this alert message pops up… only the enabling part doesn’t work.
I have tried to push the code to enable the button again with the webflow wrapper method, but still no luck The code exectute succesfully until the very last code block and I get the alert “reCAPTCHA callback was just called” but the last few line to enable the submit button fails somehow to execute.
So for this to work you ALSO need to have the enable btn as part of the webflow push - do you need to the reCaptcha in there too - or can it be rendered outside? I’m struggling as to when “Normal HTML and JS” will work and when it needs to be wrapped to something like this.