t4t5 / sweetalert

A beautiful replacement for JavaScript's "alert"
https://sweetalert.js.org
MIT License
22.38k stars 2.84k forks source link

I think it's because you're binding an action to "onsubmit" which will by default redirect from the page you're on. Try removing the `onsubmit=` part in your HTML and add this to your JavaScript instead (using jQuery): #1007

Open mereminiGit opened 1 year ago

mereminiGit commented 1 year ago
          I think it's because you're binding an action to "onsubmit" which will by default redirect from the page you're on. Try removing the `onsubmit=` part in your HTML and add this to your JavaScript instead (using jQuery):
$( "form#measure-the-heat").submit(function(event) {

  event.preventDefault(); // Prevent the page from redirecting

  // Put the swal-code here
});

Originally posted by @t4t5 in https://github.com/t4t5/sweetalert/issues/414#issuecomment-126568556