页面中参数太多,但是用$("#moduleform").serialize()序列化之后不是json格式的,这时需要将参数重新排列成json格式传输:
//序列化参数
var params = serializeObject($("#moduleform").form());
$.ajaxMutiUpload({
type:"post",
url:url,
secureuri:true,// 安全提交,默认为false
data:params,
dataType:'json',
fileElementId:"phote",
success:function(result){
window.location.href = "${pageContext.request.contextPath}/systemObjectAction_list.action";
$.messager.show({
title:'友情提示',
msg:result.message
});
}
});
function serializeObject(form){
var obj = {};
$.each(form.serializeArray(),function(index,field){
if(obj[this['name']]){
obj[this['name']] = (obj[this['name']]) + "," + (this['value']);
}else{
obj[this['name']] = (this['value']);
}
});
//默认ajax请求显示
//obj['typeId'] = "1";
return obj;
};