Submit Form with Ajax

Use like $(“myElement”).submitWithAjax() to add unobtrusive submission via Ajax to your forms.

jQuery.fn.submitWithAjax = function() {
	this.submit(function() {
		$.post(this.action, $(this).serialize(), null, "script");
		return false;
	return this;


Share this snippet


Leave a Reply

Your email address will not be published. Required fields are marked *

Please respect the following rules: No advertising, no spam, no keyword in name field. Thank you!