function getData(form) { return Array.prototype.map.call(form, function (field) { return { name: field.name, value: field.value }; }); }