//按钮部分
<form id="submitForm" class="form-horizontal">
<button onclick="javascript:submitForm(${applyClasses.cid});" type="button" class="btn btn-primary">
<i class="fa fa-save"></i>确认提交
</button>
</form>
//js校验提交
function submitForm(cid){
//异步提交
//判断需要走哪一个方法
// var a=1;
if(cid==null||cid==""){
var rows = $('#submitForm').serializeArray();
// console.log("a,",a);
console.log(rows,"rows");
for (i = 1; i < rows.length; i++) {
if(rows[i].value==null||rows[i].value==""){
$.messager.show({
title:'提示信息',
msg:"以上都是必填字段,请全部填写",
timeout:2000,
showType:'slide'
});
// return a=2;
}
}