Skip to content

Instantly share code, notes, and snippets.

@kumaraswins
Created August 1, 2020 05:04
Show Gist options
  • Save kumaraswins/afbe303db05d3ad3d037db9aeaa09d6d to your computer and use it in GitHub Desktop.
Save kumaraswins/afbe303db05d3ad3d037db9aeaa09d6d to your computer and use it in GitHub Desktop.

Revisions

  1. kumaraswins created this gist Aug 1, 2020.
    7 changes: 7 additions & 0 deletions Serialize form fields to json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    var formulateData = function(oList){
    var json = {};
    for (var i=0;i<oList.length;i++){
    json[oList[i]["name"]] = oList[i]["value"]
    }
    return {"data":json};
    }