Skip to content
Advertisement

How to alert success message in modal form?

I’m new to ajax/jquery. I want to use sweetalert on my website, i set it up as in tutorial, but when i open modal form and click send button, it goes to another page, page send.php.

Here my form:

JavaScript

inside this form sweetalert doesn’t work, but outside of form it’s working.

Here sweetalert jquery and ajax request:

JavaScript

what could be the problem? Please help

Advertisement

Answer

The problem is you’re not sending request with AJAX.

Solution:

First remove action="send.php" from your form

then add this to your script.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement