window.getRecaptchaToken_mailingsignup = function(onSuccess, onError) { window.grecaptcha.execute("6LcR-24qAAAAAK99mViHCeY9rFc5bOxreCV-78VH", { action: "mailingsignup" }).then(function (token) { const element = document.getElementById("g-recaptcha-response-qshgnvvxuibvgkor"); if (element) { element.value = token; } onSuccess(token, "mailingsignup", "39efcdee4c3f57aeca42ef5bf562ed05ff54084e46527e46f0393a0c60ec99e8mailingsignup"); }).catch(onError); } window.submitFormWithRecaptcha_mailingsignup = function (token) { const form = document.getElementById("mailinglist"); const buttons = form.getElementsByClassName("g-recaptcha"); if (buttons && buttons.length > 0) { for (let button of buttons) { button.disabled = true; const currentClasses = Array.from(button.classList); for (let cls of currentClasses) { if (cls.startsWith('bg-')) { const bgClass = cls === 'bg-transparent' ? 'bg-grey' : cls + '-hover'; button.classList.remove(cls); button.classList.add(bgClass); } } button.innerText = 'Submitting ...'; }; } document.getElementById("g-recaptcha-response-mailingsignup").value = token; form.submit(); }