Skip to content

Instantly share code, notes, and snippets.

@egulhan
Created March 26, 2015 06:30
Show Gist options
  • Select an option

  • Save egulhan/6c9ef938d7e1e472a90c to your computer and use it in GitHub Desktop.

Select an option

Save egulhan/6c9ef938d7e1e472a90c to your computer and use it in GitHub Desktop.
Post form with submit button value using Ajax
$("#mySubmit").click(function() {
var formData = $(this).closest('form').serializeArray();
formData.push({ name: this.name, value: this.value });
//now use formData, it includes the submit button
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment