From c029d47157400a9c5cf5042038251c8a398cca25 Mon Sep 17 00:00:00 2001 From: 08draven Date: Fri, 1 Nov 2024 17:53:00 -0400 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) { %> - + <% } %>