version 1.22, 2024/03/28 19:04:03 |
version 1.23, 2024/03/28 19:16:14 |
|
|
const form = document.querySelector("#cform"); |
//const form = document.querySelector("#cform"); |
|
|
function validateEmail(email) { |
function validateEmail(email) { |
const regex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; |
const regex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; |
Line 13 function validateMsg(msg) { |
|
Line 13 function validateMsg(msg) { |
|
return (msg.length>5); |
return (msg.length>5); |
} |
} |
|
|
async function postData() { |
//async function postData() { |
const formData = new FormData(form); |
// const formData = new FormData(form); |
try { |
// try { |
const response = await fetch("/feedbk/", { |
// const response = await fetch("/feedbk/", { |
method: "POST", |
// method: "POST", |
body: formData, |
// body: formData, |
}); |
// }); |
console.log(await response.json()); |
// console.log(await response.json()); |
} catch (e) { |
// } catch (e) { |
console.error(e); |
// console.error(e); |
} |
// } |
} |
//} |
|
|
async function sendData() { |
async function sendData() { |
var er = 0; |
var er = 0; |
Line 55 async function sendData() { |
|
Line 55 async function sendData() { |
|
callback: function(token) { |
callback: function(token) { |
ii.textContent="Sent"; |
ii.textContent="Sent"; |
console.log(`Challenge Success ${token}`); |
console.log(`Challenge Success ${token}`); |
postData(); |
// postData(); |
|
var data=`${token};${em};${su};${ms}`, |
|
status=""; |
|
$.post("/feedbk/", function(data, status){ |
|
alert("Data: " + data + "\nStatus: " + status); |
|
|
|
|
|
|
}, |
}, |
}); |
}); |
}); |
}); |