[BACK]Return to form.min.js CVS log [TXT][DIR] Up to [local] / draft

Diff for /draft/form.min.js between version 1.25 and 1.64

version 1.25, 2024/03/28 19:18:36 version 1.64, 2024/03/30 15:51:42
Line 1 
Line 1 
 //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() {  
 //  const formData = new FormData(form);  
 //  try {  
 //    const response = await fetch("/feedbk/", {  
 //      method: "POST",  
 //      body: formData,  
 //    });  
 //    console.log(await response.json());  
 //  } catch (e) {  
 //    console.error(e);  
 //  }  
 //}  
   
 async function sendData() {  async function sendData() {
         var er = 0;          var er = 0;
                 em = document.getElementById("cfem").value,                  em = document.getElementById("cfem").value,
Line 49  async function sendData() {
Line 36  async function sendData() {
                         turnstile.render('#cfcontainer', {                          turnstile.render('#cfcontainer', {
                                 theme: 'light',                                  theme: 'light',
                                 sitekey: '0x4AAAAAAAVpXFEy152AON1L',                                  sitekey: '0x4AAAAAAAVpXFEy152AON1L',
                                   'response-field': false,
                                   retry: 'never',
                                 'error-callback': function(e) {                                  'error-callback': function(e) {
                                         turnstile.remove();                                          turnstile.remove();
                                 },                                  },
                                 callback: function(token) {                                  callback: function(token) {
                                         ii.textContent="Sent";                                          ii.textContent="Sent";
                                         console.log(`Challenge Success ${token}`);                                          console.log(`Challenge Success ${token}`);
 //                                      postData();  
 var data=`${token}|${em}|${su}|${ms}`,  
         status="";  
 $.post("/feedbk/", function(data, status){  
     alert("Data: " + data + "\nStatus: " + status);                             });  
   
   const dataToSend = JSON.stringify({"email": "hey@mail.com", "password": "101010"});
   fetch("/feedbk/", {
           credentials: "same-origin",
           mode: "same-origin",
           method: "post",
           headers: { "Content-Type": "application/json" },
           body: dataToSend
   })
         .then(response => response.json())
         .then(json => console.log(json))
   
   
   
   
   
   

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.64

https://cvs.kroczynski.net