Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

form serialize object javascript

function objectifyForm(formArray) {//serialize data function

  var returnArray = {};
  for (var i = 0; i < formArray.length; i++){
    returnArray[formArray[i]['name']] = formArray[i]['value'];
  }
  return returnArray;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #form #serialize #object #javascript
ADD COMMENT
Topic
Name
3+8 =