const codeMobile=document.getElementById("codeMobile"),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=codeMobile.value.trim();0===e.length?(div1.classList.remove("success"),codeMobile.classList.add("error-input"),messageError1.classList.add("show-error-message")):e.length>=3?(div1.classList.add("success"),codeMobile.classList.remove("error-input"),messageError1.classList.remove("show-error-message")):e.length<3&&(div1.classList.remove("success"),codeMobile.classList.add("error-input"),messageError1.classList.add("show-error-message"))}),codeMobile.addEventListener("input",function(){let e=codeMobile.value.trim();0===e.length?(div1.classList.remove("success"),codeMobile.classList.add("error-input"),messageError1.classList.add("show-error-message")):e.length>=3?(div1.classList.add("success"),codeMobile.classList.remove("error-input"),messageError1.classList.remove("show-error-message")):e.length<3&&(div1.classList.remove("success"),codeMobile.classList.add("error-input"),messageError1.classList.add("show-error-message"))});