Skip to content

Instantly share code, notes, and snippets.

@BenjaminAdams
Created September 29, 2013 20:04
Show Gist options
  • Save BenjaminAdams/6756035 to your computer and use it in GitHub Desktop.
Save BenjaminAdams/6756035 to your computer and use it in GitHub Desktop.
How to properly serialize a form into a javascript object
var data = {};
$(".form-selector").serializeArray().map(function(x){data[x.name] = x.value;})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment