$("#f1").validator({
stopOnError:true,
focusInvalid:false,
focusCleanup:true,
must:true,
timely:false,
fields : {
accName : {
rule : "required",
msg : {
required : "请填写帐号名称"
}
},
accNo : {
rule : "required;accNoRemote",
msg : {
required : "请输入帐号",
accNoRemote : "帐号已存在"
},
ok : "帐号可用"
},
accBank:{
rule:"required;",
msg : {
required : "请填写账户信息"
}
}
},
rules:{
accNoRemote:function(){
var id = $("#accId").val();
var accNo = $("#ipt_accNo").val();
return $.ajax({
url:"/acc/checkAccNo",
type:"post",
data:{"id":id,"accNo":accNo},
async:false,
dataType:"text",
success:function(r){
}
});
}
},
invalid:function(){
_lock_si = false;
},
valid:function(form){
$.WAITING({//显示等待图标
"z-index" : "9990"
});
if($("#sel_bankType").val() == "-请选择-"){
$("#error_bankType").text("请选择银行类型");
_lock_si = false;
$.CLEAR(1);//清除信息
return ;
}
$("#f1").ajaxSubmit(function(r) {//提交修改内容
$.RESULT(r, function() {
if (r.data) {//保存成功
U.showalert(r.msg);
JP.topage();//重新加载
$.CLEAR();//清除提示信息及等待样式
} else {
U.showalert(r.msg);
_lock_si = false;//提交失败,解除锁定
$.CLEAR(1);//清楚界面
}
});
});
}
});
相关分类