send serialized form data jquery

Solutions on MaxInterview for send serialized form data jquery by the best coders in the world

showing results for - "send serialized form data jquery"
Pietro
13 Nov 2016
1var paramObj = {};
2$.each($('#myForm').serializeArray(), function(_, kv) {
3  if (paramObj.hasOwnProperty(kv.name)) {
4    paramObj[kv.name] = $.makeArray(paramObj[kv.name]);
5    paramObj[kv.name].push(kv.value);
6  }
7  else {
8    paramObj[kv.name] = kv.value;
9  }
10});