Skip to content

Instantly share code, notes, and snippets.

@MiraiTunga
Created April 3, 2018 23:44
Show Gist options
  • Save MiraiTunga/75efeab7f868498c491c865e00399a14 to your computer and use it in GitHub Desktop.
Save MiraiTunga/75efeab7f868498c491c865e00399a14 to your computer and use it in GitHub Desktop.
Prevents google recaptcha from timing out in Business catalyst and adds a refresh captcha link
//add script to end of form
(function ($) {
$( window ).load(function() {
SetRefreshButton();
});
window.setInterval(function(){
reCaptchaV2Manager.onLoadHandler();
}, 120000);
function SetRefreshButton() {
var button = '<a href="#" onclick="reCaptchaV2Manager.reloadControls(); return false;">Reload Captcha</a>';
$('.g-recaptcha').parent().append(button);
}
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment