get form data jquery on click as object code example
Example: get form data as object jquery
var paramObj = {};
$.each($('#myForm').serializeArray(), function(_, kv) {
if (paramObj.hasOwnProperty(kv.name)) {
paramObj[kv.name] = $.makeArray(paramObj[kv.name]);
paramObj[kv.name].push(kv.value);
}
else {
paramObj[kv.name] = kv.value;
}
});