add google reCAPTCHA in the newsletter form in magento

0
213

source url
http://stackoverflow.com/questions/40035052/how-to-add-google-recaptcha-in-the-newsletter-form-in-magento

var onloadCallback = function() {
grecaptcha.render(‘recaptcha-1’, {
‘sitekey’: “6Lf9tBcTAAAAAEbCd2XlhPGH3o850Qp9ZMJJ2fr2”,
‘theme’: “light”,
‘callback’: function(response) {
if (response.length > 0) {
$(‘recaptcha-verification-1’).writeAttribute(‘value’, ‘checked’);
$(‘recaptcha-verification-1’).checked = true;
}
}
});
};

<a href=”https://www.google.com/recaptcha/api.js?onload=onloadCallback&amp;render=explicit&amp;hl=en”>https://www.google.com/recaptcha/api.js?onload=onloadCallback&amp;render=explicit&amp;hl=en</a>

</div>