var obj = {}; for( var i = 0; i < elem_form.elements.length; i++ ){ var elem = elem_form.elements[i]; var e_name = elem.name || ""; var e_value = elem.value; if(e_name == ""){ continue; } eval("obj = $.extend({ " + elem.name + ": e_value }, obj)"); }