title: Making delay with form-submit-redirecting
body: <p>I'm using Liveform service for emailing in my web. right now every time you submit It should alert with a message of fail or success.</p>
  
  <p>While showing fail message works, showing the success message doesn't- since I get redirect before it has the chance to show up. So I need to somehow delay it.</p>
  
  <p>this is my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    $('#emailError').removeClass('active');
    $('#contact-form').submit(function(e) {
      var email = $('#email').val();
      console.log(email);
      var message = $('#message').val();
      console.log(message);
  
      if (!email || !message) {
        alertify.error('Please enter an email and a message');
        e.preventDefault();
        return;
      }
      // REDIRECT IN THIS POINT- &gt; HOW TO DELAY HERE?
      setTimeout(function() {
        alertify.success('SENT SUCCESSFULLY!');
      }, 3000);
    });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form action="https://liveformhq.com/form/911331a2-0d5e-4fbf-abb0-******" method="POST"
                accept-charset="utf-8" id="contact-form"&gt;
                &lt;input type="email" placeholder="Email..." id="email" name="email" /&gt;
                &lt;textarea rows="4" cols="50" placeholder="Message..." id="message" name="message"&gt;&lt;/textarea&gt;
                &lt;div class="actions"&gt;&lt;button type="submit"&gt;Send&lt;/button&gt;&lt;/div&gt;
              &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>How can I make the server wait for some seconds until the alert shows up?
  As you can see using the timeout as I did didn't work.</p>
  
  <p>thanks</p>