Skip to content

Instantly share code, notes, and snippets.

@Noleli
Created May 14, 2012 16:31
Show Gist options
  • Save Noleli/2694935 to your computer and use it in GitHub Desktop.
Save Noleli/2694935 to your computer and use it in GitHub Desktop.
JSONify form
formdata = $('#theform').serializeArray();
data = {};
$(formdata).each(function() {
data[this.name] = this.value;
});
data = JSON.stringify(data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment