title: I want to delay a form action, but still have it submit before I redirect
body: <p>I have a standard form with some text inputs and a submit button at the bottom. Its action currently redirects to my homepage, but I want it to submit the form, and <em>then</em> redirect a second or two later. </p>
  
  <p>I found a similar question at: <a href="https://stackoverflow.com/questions/6291512/delay-page-redirect-after-form-submit-using-jquery-js">Delay page redirect after form submit using jquery / js?</a>, but the answer there just delayed for a period of time, then submitted and redirected simultaneously.</p>
  
  <p>If it's any help, here is a mini-version of my form</p>
  
  <pre><code>&lt;form action="/home" onsubmit="createAdd({{ newID }}, {{ user.get_profile.id }})" class="form-horizontal" method="post"&gt;{% csrf_token %}
   &lt;div class="control-group"&gt;
      &lt;label class="control-label" for="newName"&gt;Name*&lt;/label&gt;
      &lt;div class="controls"&gt;
        &lt;input type="text" name="newName" id="name" required&gt;
     &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="control-group"&gt;
      &lt;div class="controls"&gt;
        &lt;button type="submit" class="btn btn-primary" value="Create"&gt;&lt;i class="icon-wrench icon-white"&gt; &lt;/i&gt; Create &lt;/button&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>My AJAX:</p>
  
  <pre><code>function createAdd(event, user){  
  
      $.ajax({
      url: '/eventsearch/eventsearch/createCustom/',
      type: "POST",
      data: {name: name, loc: loc, start: start, end: end, tags: tags, event_id: event, profile: user},
      success: function(){
          window.setTimeout(function () {
              window.location.href = '/eventsearch/eventsearch/';
          }, 2000);
      }
      });
  }
  </code></pre>