//form序列化后 转json
function arrayToJson(formArray){
var dataArray = {};
$.each(formArray,function(){
if(dataArray[this.name]){
if(!dataArray[this.name].push){
dataArray[this.name] = [dataArray[this.name]];
}
dataArray[this.name].push(this.value || ‘‘);
}else{
dataArray[this.name] = this.value || ‘‘;
}
});
return JSON.stringify(dataArray);
}
//提交
Submit = function(){
if( confirm("确认提交吗?") ){
//form表单序列化
var form = $(parent.mainFrame.form1).serializeArray();
var form = arrayToJson(form);
$.ajax({
type :‘post‘,
url :‘../‘,
data : {
form : form,
ID : $("#idCard").html()
},
async:false,
dataType : ‘josn‘,
success : function(data){
}
});
}
}