document.querySelector('Formulario').addEventListener('submit', function(e) { const phoneInput = document.querySelector('[name="celular"]'); // Adjust with your phone field's name attribute if (phoneInput.value.length < 10) { e.preventDefault(); alert("Por favor poner número de celular."); phoneInput.focus(); } });