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

148
Views
How to set form submission redirection on different page (5 second interval) using jquery

I like to setup 5 second interval after form submission, then redirect to different page.

here is html code:

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

Right now,I'm using this jquery for redirect onclick 5 second interval.

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

I changed .click(function() to .submit(function() but didn't worked.

is there have any way to set 5 second interval after submitting form?

Thank you.

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

0

Use preventDefault() to stop form submission and execute your code

$('#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!