Snippets

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;
};

Source: http://snipplr.com/view/9870/jquery-submit-form-with-ajax/...

Share this snippet