Created
June 6, 2018 22:56
-
-
Save joseph-tran-tn/69bd333670a354b891becf8ae753df1b to your computer and use it in GitHub Desktop.
Convert form data to JavaScript object with jQuery Ask Question
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
function objectifyForm(formArray) { //serializeArray data function | |
var returnArray = {}; | |
for (var i = 0; i < formArray.length; i++){ | |
returnArray[formArray[i]['name']] = formArray[i]['value']; | |
} | |
return returnArray; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment