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

146
Views
Cómo configurar la redirección de envío de formularios en una página diferente (intervalo de 5 segundos) usando jquery

Me gusta configurar un intervalo de 5 segundos después del envío del formulario y luego redirigir a una página diferente.

aquí está el código html:

 <button type="button" id="submit">Submit</button>

En este momento, estoy usando este jquery para redirigir al hacer clic en un intervalo de 5 segundos.

 $('#submit').click(function(){ setTimeout(function(){ window.location.href='index.php'; },5000); });

Cambié .click(function() a .submit(function() pero no funcionó).

¿Hay alguna forma de establecer un intervalo de 5 segundos después de enviar el formulario?

Gracias.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Use preventDefault() para detener el envío de formularios y ejecutar su código

 $('#submit').on('click', function(e){ e.preventDefault(); setTimeout(function(){ window.location.href='index.php'; },5000); });
about 4 years ago · Juan Pablo Isaza Report
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!