This document outlines how to add Google Invisible reCAPTCHA to an existing client site.
Add the keys for Invisible reCAPTCHA to all of the app.conf
files.
define('INVISIBLE_RECAPTCHA_SECRET', '6LffLzMUAAAAAF5sLOiL9B-I3YorftHLKUMEI1vy');
define('INVISIBLE_RECAPTCHA_SITE_KEY', '6LffLzMUAAAAAOJVMIX3a2PZcJhnYFbEO1z3K7Rw');
Add the drop-in component to the form you want to validate with the invisible argument set to true. This can be placed anywhere within the form tags, but typically goes toward the bottom before the closing </form>
tag.
{render_dropin dropin="ReCaptcha" invisible=true}
Add the following function to /actions/ctrl_Forms.action.php/
.
protected function requireReCaptcha()
{
return true;
}
Add the class invisible-recaptcha
to the form you are submitting.
<form action="/forms/" class="validate-form invisible-recaptcha">