title: loading progress form submit using sweetalert
body: <p>I would like to render a waiting time animation when submitting a form, but I prefer to use <code>SweetAlert</code> rather than a standard loading image.</p>
  
  <p>This the basic 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>$("form").submit(function (e) {
              e.preventDefault(); // stops the default action
              $("#loader").show(); // shows the loading screen
              $.ajax({
                  url: test.php,
                  type: "POST"
                  success: function (returnhtml) {
                      $("#loader").hide(); // hides loading sccreen in success call back
                  }
              });
          });</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is the code SweetAlert wants to implement:</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>window.swal({
    title: "Checking...",
    text: "Please wait",
    imageUrl: "images/ajaxloader.gif",
    showConfirmButton: false,
    allowOutsideClick: false
  });
  
  //using setTimeout to simulate ajax request
  setTimeout(() =&gt; {
    window.swal({
      title: "Finished!",
      showConfirmButton: false,
      timer: 1000
    });
  }, 2000);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert-dev.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.css" /&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>plz someone make the tips for doing this</p>