var aa=function(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;
}
Just pass a form object in. After method processing, you can return an object. For example, console.info(aa($( "#myForm"))); You can try this in Firefox browser. It's a very good method.