You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(function(){"use strict";/* * Form Validation */// Fetch all the forms we want to apply custom validation styles toconstforms=document.querySelectorAll(".needs-validation");constresult=document.getElementById("result");// Loop over them and prevent submissionArray.prototype.slice.call(forms).forEach(function(form){form.addEventListener("submit",function(event){if(!form.checkValidity()){event.preventDefault();event.stopPropagation();form.querySelectorAll(":invalid")[0].focus();}else{/* * Form Submission using fetch() */event.preventDefault();event.stopPropagation();constformData=newFormData(form);constobject=Object.fromEntries(formData);constjson=JSON.stringify(object);result.innerHTML="Please wait...";fetch("https://api.web3forms.com/submit",{method: "POST",headers: {"Content-Type": "application/json",Accept: "application/json",},body: json,}).then(async(response)=>{letjson=awaitresponse.json();if(response.status==200){result.innerHTML=json.message;result.classList.remove("text-gray-500");result.classList.add("text-green-500");}else{console.log(response);result.innerHTML=json.message;result.classList.remove("text-gray-500");result.classList.add("text-red-500");}}).catch((error)=>{console.log(error);result.innerHTML="Something went wrong!";}).then(function(){form.reset();form.classList.remove("was-validated");setTimeout(()=>{result.style.display="none";},5000);});}form.classList.add("was-validated");},false);});})();