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

Diff for /draft/form.min.js between version 1.22 and 1.23

version 1.22, 2024/03/28 19:04:03 version 1.23, 2024/03/28 19:16:14
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() {  //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);
   
   
   
                                 },                                  },
                         });                          });
                 });                  });

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

https://cvs.kroczynski.net