const firma=document.getElementById("firma"),div1=document.getElementById("div1"),messageError1=document.getElementById("messageError1"),formData=document.getElementById("fSD"),sendButton=document.getElementById("bSD");let validationData=!1;formData.addEventListener("submit",e=>{!0===div1.classList.contains("success")&&(validationData=!0),!1===validationData&&e.preventDefault()}),sendButton.addEventListener("click",()=>{let e=firma.value.trim();0===e.length?(div1.classList.remove("success"),firma.classList.add("error-input"),messageError1.classList.add("show-error-message")):e.length>=3?(div1.classList.add("success"),firma.classList.remove("error-input"),messageError1.classList.remove("show-error-message")):e.length<3&&(div1.classList.remove("success"),firma.classList.add("error-input"),messageError1.classList.add("show-error-message"))}),firma.addEventListener("input",function(){let e=firma.value.trim();0===e.length?(div1.classList.remove("success"),firma.classList.add("error-input"),messageError1.classList.add("show-error-message")):e.length>=3?(div1.classList.add("success"),firma.classList.remove("error-input"),messageError1.classList.remove("show-error-message")):e.length<3&&(div1.classList.remove("success"),firma.classList.add("error-input"),messageError1.classList.add("show-error-message"))}),firma.addEventListener("input",function(){this.value=this.value.replace(/[^0-9]/g,"")});