Skip to content

Instantly share code, notes, and snippets.

@madeas
Created April 26, 2018 09:19
Show Gist options
  • Save madeas/0197013a6a12f8178ef71d26b52b9b90 to your computer and use it in GitHub Desktop.
Save madeas/0197013a6a12f8178ef71d26b52b9b90 to your computer and use it in GitHub Desktop.
<script>
$(document).ready(function () {
$('form').submit(function () {
var formID = $(this).attr('id'); // Получение ID формы
var formNm = $('#' + formID);
$.ajax({
type: 'POST',
url: 'feedback.php', // Обработчик формы отправки
data: formNm.serialize(),
success: function (data) {
// Вывод текста результата отправки в текущей форме
$(formNm).html(data);
}
});
return false;
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment