// Encoding: UTF-8 "use strict"; var allowSubmit = false; /** * called by the captcha data-callback */ function captcha_filled() { allowSubmit = true; } /** * called by the captcha data-expired-callback */ function captcha_expired() { allowSubmit = false; } function isCaptchaFilled() { var hasCaptcha = document.getElementById("captchaDiv") !== null; if(allowSubmit || !hasCaptcha) { return true; } alert("Captcha must be filled"); return false; }