Created
September 29, 2013 20:04
-
-
Save BenjaminAdams/6756035 to your computer and use it in GitHub Desktop.
How to properly serialize a form into a javascript object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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