Skip to content

Instantly share code, notes, and snippets.

@AdamDenoon
Last active September 23, 2016 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamDenoon/2e4f4a34d84d5e76fd366fdabff8697c to your computer and use it in GitHub Desktop.
Save AdamDenoon/2e4f4a34d84d5e76fd366fdabff8697c to your computer and use it in GitHub Desktop.
Multiple reCAPTCHA Support
<div id="recap1"></div>
<div id="recap2"></div>
<script type="text/javascript">
// Support for multiple reCAPTCHAs
var verifyCallback = function(response) {
alert(response);
};
var widget1;
var widget2;
var onloadCallback = function() {
// Renders the HTML element with id 'example1' as a reCAPTCHA widget.
// The id of the reCAPTCHA widget is assigned to 'widgetId1'.
widget1 = grecaptcha.render('recap1', {
'sitekey' : "<%= ENV['recaptcha_public_key'] %>",
'theme' : 'light'
});
widget2 = grecaptcha.render('recap2', {
'sitekey' : "<%= ENV['recaptcha_public_key'] %>",
'theme' : 'light'
});
};
</script>
<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment