Answer the question
In order to leave comments, you need to log in
How to show modal window after form submit?
The fact is that the window does not have time to appear, since the page is reloaded immediately.
I'm scratching my head, how do I do this?
$(document).ready(function(){
$("#form").submit(function() { //устанавливаем событие отправки для формы с id=form
var form_data = $(this).serialize(); //собераем все данные из формы
$.ajax({
type: "POST", //Метод отправки
url: "mail/mail.php", //путь до php фаила отправителя
data: form_data,
success: function(data) {
//код в этом блоке выполняется при успешной отправке сообщения
$('.pop-up pop-up-thanks').show('100');
},
error: function(){
alert('error')
},
});
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question