Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

282
Vistas
how to submit form after calling e.preventDefault()

form.addEventListener('submit', e => {
    e.preventDefault();
    validateInputs();


});

how to submit the form in given js

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

It is not very clear from your question, but I will make this assumption:

  • I will assume that the function validateInputs returns true if all the inputs are considered valid, and returns false if there is one or more error found in the form inputs.

You can call form.submit() to programmatically submit the form.

In the context of your existing code, applying the assumption I've listed above:

form.addEventListener('submit', e => {
    e.preventDefault();

    if (validateInputs()) {
        // All inputs are valid, submit the form.
        form.submit();
    } else {
        // Run some code here that points out the problems in the form
    }
});

about 4 years ago · Juan Pablo Isaza Denunciar

0

find your submit button and add click event

function checkForm()
{
   if(validateInputs())
   {
      form.submit();
   }
}
button.addEventListener("click",checkForm);
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda