collect input fields data and build a json using key as a input name and value as input value. give a HTML form as a parameter
let buildFormJSON = function(form) {
let json = {};
$.each($(form).find('input'), function(k, v){
let key = $(v).attr('name');
let value = $(v).val();
if(key !== undefined) {
json[key] = value;
}
});
return json;
}
//comment