Created
April 8, 2015 09:25
-
-
Save isorna/72b3d59af30d7b1e4909 to your computer and use it in GitHub Desktop.
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
// requires jQuery or similar | |
function parseFormToJSON (pcSelector) { | |
var aFieldsArray = $(pcSelector).serializeArray(), | |
oJSON = {}, | |
i = 0; | |
for (i = 0; i < aFieldsArray.length; i++) { | |
oJSON[aFieldsArray[i].name] = aFieldsArray[i].value; | |
} | |
return oJSON; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment