The problem with sending a message from the form, at the time of loading from another page.
It turns out to send only from the page where the form itself. I tried instead of #form register .send . Alert sends a message about sending, but nothing comes to the mail
$(document).ready(function(e) { var btnClick = $('.link'); // кнопка, по нажатию которой будет подгружаться форма var btnCls = $('.close'); // кнопка закрытия формы btnClick.click(function() { if($( window ).width() > 768) { // данный метод будет работать только в полной версии сайта $('.send').load('ссылка на форму #form').fadeIn(4000); // подгружаем форму из указанной ссылки и ее контента $('#form').submit(function() { // устанавливаем событие отправки для формы с id=form var form_data = $(this).serialize(); // собираем все данные из формы $.ajax({ type: "POST", url: "post.php", data: form_data, success: function() { alert("Ваше сообщение отпрвлено!"); } }); }); }); } /* function btnClose() { btnCls.click(function() { $('.send').fadeOut(2000); }); } btnClose(); */ });