title: How to submit form after countdown
body: <p>I'm kind of stuck in my project i have been able to get a function for a countdown using JavaScript , the problem i'm facing now is i don't know where to set a function that's say's once it's 0:00 submit the form </p>
  
  <p>here is the html: </p>
  
  <pre><code>      &lt;form name = 'countdown' &gt;
        &lt;/form&gt;
  </code></pre>
  
  <p>here is the  Javascript</p>
  
  <pre><code>    (function($) {
  $.tinyTimer = function(options) {
      var tick, tt = this, elem = (tt.options = options).element, ref = new Date(options.from || options.to).getTime(), dir = !!options.from || -1, M = Math, doNothing = function() {};
      tt.interval = setInterval(tick = function() {
          if (!tt.paused) {
              var sec = M.max(M.round((Date.now() - ref) * dir / 1e3), 0), val = {
                  S: sec,
                  s: sec % 60,
                  M: M.floor(sec /= 60),
                  H: M.floor(sec /= 60),
                  D: M.floor(sec /= 24)
              };
              val.m = val.M % 60, val.h = val.H % 24, val.d = val.D, val.text = (options.format || "%-H{:}%0m:%0s").replace(/%(-?)(0?)([dhms])(\s*)(?:\{(.+?)\})?/gi, options.replacer || function(match, omit, zero, part, space, forms) {
                  var v = val[part];
                  return (forms = (forms || "").split("|"))[2] = forms[2] || (forms[1] = forms[1] || forms[0]), 
                  !v &amp;&amp; omit ? "" : (v &gt; 9 ? "" : zero) + v + space + forms[+(1 != v) + (1 != v &amp;&amp; (2 &gt; v % 10 || v % 10 &gt; 4) || v &gt; 10 &amp;&amp; 20 &gt; v)];
              }), elem ? $(elem).html(val.text) : elem = tt, (options.onTick || doNothing).call(elem, tt.val = val), 
              0 &gt; dir &amp;&amp; !sec &amp;&amp; (clearInterval(tt.interval), (options.onEnd || doNothing).call(elem, val));
          }
      }, 1e3), tick(), tt.pause = tt.stop = function() {
          tt.paused = Date.now();
      }, tt.resume = function() {
          ref -= (tt.paused - Date.now()) * dir, tt.paused = 0;
      }, tt.start = function() {
          tt.paused = 0;
      };
  }, $.fn.tinyTimer = function(options) {
      return this.each(function() {
          $(this).data("tinyTimer", new $.tinyTimer($.extend(options, {
              element: $(this)
          })));
      });
  };
  })(jQuery);
  
  var d = new Date();
  d.setMinutes(d.getMinutes() + 5);
  $('#timer').tinyTimer({ to: d });
  </code></pre>
  
  <p>Please any help will be appreciated .Thanks</p>