1.Form表单不提交,不想后台发送请求,还不报错:
var validateCode = function(code, callback, dialog, url) {
var flag=dialog.find('form').form('validate');
if(!flag){
dialog.find('.dialog-button .l-btn:first-child').linkbutton('enable');
}
dialog.find('form').form('asyncSubmit', {
url : contextPath + '/mvc/zntc/curd/pathbasemaintain/service/exist?code=' + code,
success:function(data){
if(data == true){
dialog.find('.dialog-button .l-btn:first-child').linkbutton('enable');
$.Msg.alert('提示',code+'编码已存在!');
}else{
callback(dialog, url);
}
}
});
};
出现此种情况的原因为表单验证未通过(代码中标红flag),虽然代码会继续向下执行,但不想后台发送请求,原因为easyui的源码中自带了form表单验证功能,但其验证结果没有提示