We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Ian Morris • 5 years ago

Jami,

I was just able to figure out how to get this working. This code was so helpful! However, I want to implement v3. Are there any differences I should know about between the different versions?

Jami Gibbs • 5 years ago

v3 is a bit easier but still the same concept. You would still use a Visual Force page through an iframe to load the script, get the token, and check that against a secret key with the backend. But those steps would all happen after the component's initial render. In Aura, this would be done in the afterRender file and in LWC, probably renderedCallback (with a caveat that you want to set an initial load variable so that it doesn't get called after each render). It should happen there because in v3, the Google recaptcha validation occurs without user interaction (the user doesn't have to do a photo selection like in v2). So once you've validated the token against the secret key in your initial render, make the submit button active if it's valid, otherwise, make it disabled or something. How you handle disabling the form is up to you.

Santanu Roy • 4 years ago

Hi Jami this is exactly what i wanted and very helpful .. please share the githuburl of this project I need to see te apex code also ..thanks for the same....

Gurditta Garg • 5 years ago

Hi Jami,

Do you full code by chance, it's incomplete. Thanks in advance!

Jami Gibbs • 5 years ago

Hello,

There are some gaps like form validation and form submission because that can depend on your specific use case. Can you be more specific about what you're after?