From d5daf958cf2862b00e7d471ba6fa5b55075bfd20 Mon Sep 17 00:00:00 2001 From: biglyderv Date: Mon, 25 Nov 2024 14:12:44 -0500 Subject: [PATCH] refresh captcha if it is wrong --- static/main.js | 2 ++ views/form_bare.ejs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/static/main.js b/static/main.js index 17df8dd..e5bd064 100644 --- a/static/main.js +++ b/static/main.js @@ -16,6 +16,8 @@ async function formClick(ev) { let json = await fetched.json(); + target.querySelector('.captcha').src += '&a=b'; + target.querySelector('.form-message').textContent = json.message; if (json.redirect) { diff --git a/views/form_bare.ejs b/views/form_bare.ejs index 3d4980a..633938a 100644 --- a/views/form_bare.ejs +++ b/views/form_bare.ejs @@ -5,7 +5,7 @@
<% if (!noCaptcha) { %> - + <% } %>