=================================================================== RCS file: /cvs/cvs/draft/form.min.js,v retrieving revision 1.86 retrieving revision 1.93 diff -u -p -r1.86 -r1.93 --- draft/form.min.js 2024/03/31 16:02:41 1.86 +++ draft/form.min.js 2024/03/31 16:36:02 1.93 @@ -43,7 +43,8 @@ async function sendData() { if(erro) { info.textContent="One or more fields have an error. Please check and try again." } else { - var fcon = document.querySelectorAll(".wpcf7-form-control"); + var fcon = document.querySelectorAll(".wpcf7-form-control"), + id = "(NULL)"; info.textContent="Please wait..." fcon.forEach((f) => { @@ -51,46 +52,34 @@ async function sendData() { l=f; }); l.style.visibility="hidden"; - } - -// ============================================================= // - -/* turnstile.ready(function() { turnstile.render('#cfcontainer', { + retry: 'never', theme: 'light', - sitekey: '0x4AAAAAAAVpXFEy152AON1L', 'response-field': false, - retry: 'never', + sitekey: '0x4AAAAAAAVpXFEy152AON1L', 'error-callback': function(e) { - ii.textContent="Cloudflare Turnstile verification error. Try again later." + info.textContent="Cloudflare Turnstile verification error. Try again later." }, callback: function(token) { - const dataToSend = JSON.stringify({"add": em, "sub": su, "msg": ms, "tok": token}); - ii.textContent="Sending..."; - - - -fetch("/feedbk/", { - credentials: "same-origin", - mode: "same-origin", - method: "post", - headers: { "Content-Type": "application/json" }, - body: dataToSend -}) - .then(response => response.json()) - .then(json => ii.textContent=json['msg']) - - - }, + info.textContent=token; +// const data = JSON.stringify({"add": mail, "sub": subj, "msg": mess, "tok": token}); +// info.textContent="Sending..."; +// fetch("/feedbk/", { +// headers: { "Content-Type": "application/json" }, +// credentials: "same-origin", +// mode: "same-origin", +// method: "post", +// body: data +// }) +// .then(response => response.json()) +// .then(json => info.textContent=json['msg']) + } }); - +// turnstile.remove(); }); - turnstile.remove(); - turnstile.close(); - } - */ -}; + }; +} form.addEventListener("submit", (event) => { event.preventDefault();