Last active
November 19, 2018 00:04
-
-
Save MohamedLamineAllal/7a2684b02569b50e9138d8c72d2fe3ce to your computer and use it in GitHub Desktop.
turn array data from serializeArray() jquery method to object format
This file contains hidden or 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 formArrayToObject(formArray) {//serialize 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