Salesforce Web to Lead and reCaptcha

Soldato
Joined
18 Oct 2002
Posts
14,915
Hi all,

Does anyone have any experience with Salesforce Web to Lead? I'm setting up a form and I've run into an odd issue.

The form uses reCaptcha and the code is generated in the Salesforce backend.

If I fill in all of the required fields, tick the 'I'm not a Robot' reCaptcha and click submit, everything works as expected, I'm redirected to my success page and I get a new lead in Salesforce. Great.

If I fill in all of the fields, don't tick the reCaptcha but click submit, I'm taken to my success page anyway and, obviously, I don't get a new lead in Salesforce. Not great UX.

It seems bizarre that Salesforce doesn't include validation of the reCaptcha (like it does with other required fields) before allowing you to click submit.

I followed this tutorial which disables the submit button until the reCaptcha validates but then, even though everything seemed to submit successfully, the lead was never actually generated in Salesforce.

Anyone got any bright ideas?

Thanks for any help you can give me.
 
Does it work without the capture? I used to administrate sales force and I did have to implement web to lead but I never come across any issues with that.
Yep, all works fine without captcha.

I’ve actually solved it, although it’s a bit of an odd solution.

If I make the captcha ‘required’ in the source HTML it doesn’t seem to do anything but if I use jQuery to add ‘required’ when it identifies a div with
#g-recaptcha then it seems to work with standard HTML5 validation…

Strange but at least I seem to have cracked it.
 
Back
Top Bottom