We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

tylerhall on 07/12/06


Tagged

form delay submit


Versions (?)


Who likes this?

2 people have marked this snippet as a favorite

luman
mary


Delayed Form Submit


Published in: JavaScript 


URL: http://holdren.com

Wait a specified after clicking "submit" before actually submitting a form.

  1. function waitThenSubmit(sec) {
  2. setTimeout("document.forms[0].submit();", sec * 1000);
  3. return false;
  4. }
  5.  
  6. <form onsubmit="return waitThenSubmit(5);">
  7. </form>

Report this snippet 

You need to login to post a comment.