=================================================================== RCS file: /cvs/cvs/draft/form.min.js,v retrieving revision 1.93 retrieving revision 1.94 diff -u -p -r1.93 -r1.94 --- draft/form.min.js 2024/03/31 16:36:02 1.93 +++ draft/form.min.js 2024/03/31 16:50:24 1.94 @@ -44,9 +44,8 @@ async function sendData() { info.textContent="One or more fields have an error. Please check and try again." } else { var fcon = document.querySelectorAll(".wpcf7-form-control"), - id = "(NULL)"; - info.textContent="Please wait..." + info.textContent="Verifying..." fcon.forEach((f) => { f.disabled=true; l=f; @@ -59,12 +58,14 @@ async function sendData() { 'response-field': false, sitekey: '0x4AAAAAAAVpXFEy152AON1L', 'error-callback': function(e) { - info.textContent="Cloudflare Turnstile verification error. Try again later." + info.textContent="Verification error. Try again later." + turnstile.remove(); }, callback: function(token) { - info.textContent=token; -// const data = JSON.stringify({"add": mail, "sub": subj, "msg": mess, "tok": token}); -// info.textContent="Sending..."; + const data = JSON.stringify({"add": mail, "sub": subj, "msg": mess, "tok": token}); + turnstile.remove(); + info.textContent="Sending..."; + console.log(data); // fetch("/feedbk/", { // headers: { "Content-Type": "application/json" }, // credentials: "same-origin", @@ -74,9 +75,9 @@ async function sendData() { // }) // .then(response => response.json()) // .then(json => info.textContent=json['msg']) + } }); -// turnstile.remove(); }); }; }