From d48ba6113a0415571476fd9c8422d23ebcbf79dc Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sat, 8 Feb 2025 18:52:20 +0100 Subject: [PATCH] ajax.js: fix previous commit --- js/ajax.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/js/ajax.js b/js/ajax.js index d2319f39..0401cca7 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -19,16 +19,17 @@ $(window).ready(function() { // Enable submit button if disabled (cache problem) $('input[type="submit"]').removeAttr('disabled'); - // In the captcha is present, halt if it does not have a response.. - if (captcha_renderer && postCaptchaId && !captcha_renderer.hasResponse(postCaptchaId)) { - captcha_renderer.execute(postCaptchaId); - return false; - } - var setup_form = function($form) { $form.submit(function() { if (do_not_ajax) return true; + + // In the captcha is present, halt if it does not have a response.. + if (captcha_renderer && postCaptchaId && !captcha_renderer.hasResponse(postCaptchaId)) { + captcha_renderer.execute(postCaptchaId); + return false; + } + var form = this; var submit_txt = $(this).find('input[type="submit"]').val(); if (window.FormData === undefined)