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

249
Visualizações
ReactJs - Reset field after "x" time after submit

The task is to empty the fields after clicking the "submit" button... I used this function:

setInterval(
        function submitForm() {
            document.getElementById("algo").reset();
        }, 3000);

But the problem is that it takes one or two seconds to send the mail and the function is executed instantly, the result is that the fields are emptied and then the mail is sent (arriving empty) ... in that order (function --> submit) and the real success must be : submit --> function

In addition, the function does not work since the interval is short if the message is long and it is long if I put "submit" and the text continues without disappearing

about 4 years ago · Juan Pablo Isaza
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