1var form = document.querySelector('form');
2var data = new FormData(form);
3
1function objectifyForm(formArray) {//serialize data function
2
3 var returnArray = {};
4 for (var i = 0; i < formArray.length; i++){
5 returnArray[formArray[i]['name']] = formArray[i]['value'];
6 }
7 return returnArray;
8}