version 1.87, 2024/03/31 16:13:39 |
version 1.92, 2024/03/31 16:35:25 |
Line 43 async function sendData() { |
|
Line 43 async function sendData() { |
|
if(erro) { |
if(erro) { |
info.textContent="One or more fields have an error. Please check and try again." |
info.textContent="One or more fields have an error. Please check and try again." |
} else { |
} else { |
var fcon = document.querySelectorAll(".wpcf7-form-control"); |
var fcon = document.querySelectorAll(".wpcf7-form-control"), |
|
id = "(NULL)"; |
|
|
info.textContent="Please wait..." |
info.textContent="Please wait..." |
fcon.forEach((f) => { |
fcon.forEach((f) => { |
Line 61 async function sendData() { |
|
Line 62 async function sendData() { |
|
info.textContent="Cloudflare Turnstile verification error. Try again later." |
info.textContent="Cloudflare Turnstile verification error. Try again later." |
}, |
}, |
callback: function(token) { |
callback: function(token) { |
const data = JSON.stringify({"add": mail, "sub": subj, "msg": mess, "tok": token}); |
info.textContent=token; |
info.textContent="Sending..."; |
// 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(); |
}); |
}); |
info.textContent="Fin"; |
|
turnstile.remove(); |
|
}; |
}; |
} |
} |
|
|
// ============================================================= // |
|
/*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']) |
|
|
|
turnstile.close(); |
|
}*/ |
|
|
|
form.addEventListener("submit", (event) => { |
form.addEventListener("submit", (event) => { |
event.preventDefault(); |
event.preventDefault(); |