jquery validate 使用
$(function(){
?//开启隐藏域检测(validate默认不检测)
??$.validator.defaults.ignore = "" ;
?$("#approveConfigForm").validate({
???
???onfocusout:false ,
???onkeyup:false ,
???onclick:false ,
???submitHandler:?function(form)?{
??? //将class已jbox-开始的元素移除,避免对后面的提示照成影响
???$("[class^=jbox-]").remove();
???//验证成功
???$.jBox.confirm("确认保存?","提示",function(v,h,f){
??????? ???if(v == 'ok'){
??????? ????form.submit(); ??
??????? ??? ?return ;
??????? ???}
????});?
??????},
???rules:{
????"approveSerialNumber.organizationid":{
???? ?remote:{
?? ?? ??url:"/approve/config/approve-serial-number!existOrg.action",
?? ?? ??type:"get",
?? ?? ??data:{"oldOrgid":$("#oldorgid").val()}
?? ?? ?}
????},
????"approveSerialNumber.precode":{
???? ?remote:{
?? ?? ??url:"/approve/config/approve-serial-number!existPreCode.action",
?? ?? ??type:"get",
?? ?? ??data:{"oldcode":$("#oldcode").val()}
?? ?? ?}
????}
????
???},
???messages:{
????"approveSerialNumber.organizationid" :{
????? ??remote:"该部门已存在!"
????? ?},
???? "approveSerialNumber.precode" :{
????? ??remote:"该前缀字符已存在!"
????? ?}
???}
??});
});