franhaselden
2/9/2015 - 5:27 PM

Use jQuery to send a form with POST vars

Use jQuery to send a form with POST vars

$(function () {
	$('form').on('submit', function (e) {
	e.preventDefault();
	$.ajax({
		type: 'post',
		url: 'post-form.php',
		data: $('form').serialize(),
		success: function () {
			$('#success-message').fadeIn("fast");
		}
		});

	});
});