title: Sweetalert2 displays for a second and then disappears
body: <p>I have a form with a submit button. The button has the following:</p>
  
  <pre><code>&lt;button type="submit" class="btn btn-primary btn-block" name='submit' \ 
  onclick='return confirm(\"Are you sure? This operation cannot be undone!\")"&gt;Submit&lt;/button&gt;
  </code></pre>
  
  <p>Now, i'm trying to convert the confirm to sweetalert2. </p>
  
  <p>I got this going</p>
  
  <pre><code>&lt;script language="JavaScript"&gt;
  function confirm(){
  Swal.fire({
    title: 'Are you sure?',
    text: "This operation cannot be undone!",
    type: 'warning',
    showCancelButton: true,
    confirmButtonColor: '#3085d6',
    cancelButtonColor: '#d33',
    confirmButtonText: 'Yes'
  })
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>and the submit button has been changed to this:</p>
  
  <pre><code>&lt;button type="submit" class="btn btn-primary btn-block" name='submit' \ 
      onclick='confirm()'&gt;Submit&lt;/button&gt;
  </code></pre>
  
  <p>Now...it kinda works. The popup shows up for a second and then the page refreshes and disappears. The form is submitting to itself. Obviously, I don't want this to happen. I want it to stay on the screen, once the user hits the confirm button it can do whatever it needs to do.</p>