June 6, 2016

Adding a google re-captcha into gravity form

Adding a googke re-captcha into gravity form is quite simple wor any wordpress developer.

Add the below js file in your site.

<script src=”https://www.google.com/recaptcha/api.js?onload=myCallBack&render=explicit” async defer></script>

Also create a variable in which you will be calling recaptcha.

<script defer=”defer”>
var recaptcha1;
var myCallBack = function() {
//Render the recaptcha1 on the element with ID “recaptcha1”
recaptcha1 = grecaptcha.render(‘recaptcha1’, {
‘sitekey’ : ‘6LeV3yETAAAAAM99pOH2FKwK18_Z_9aAviKQRQO0’, //Replace this with your Site key
‘theme’ : ‘light’
});
};
</script>

And Put a blank division with ID recaptcha1 in your gravity form HTML

<div id=”recaptcha1″></div>

Also you can manage your domain access for using your site key.

https://www.google.com/recaptcha/admin

You may also like...

Leave a Reply