Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

247
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!