将form表单中的元素转换成对象的方法适用表单提交
2014-10-21来源:易贤网

代码如下:

function serializeobject(form){

var o ={};

$.each(form.serializearray(),function(index){

if(o[this['name']]){

o[this['name']] = o[this['name']] +,+this['value'];

}else{

o[this['name']] = this['value'];

}

});

return o;

}

更多信息请查看IT技术专栏

推荐信息