Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

283
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda