如何建设一个优秀的电商网站,苏州天狮建设监理有限公司网站,公司企业注册信息查询,企业网站首页设计与制作validate验证在进行异步数据库查询验证的过程中用到了remote这个参数remote里面有url,dataType,data,type等等这几个参数#xff0c;当data不写的时候默认是当前被验证的字段的值。传值到php文件中#xff0c;在php文件中处理的时候#xff0c;返回值为 “true”或者f…validate验证在进行异步数据库查询验证的过程中用到了remote这个参数remote里面有url,dataType,data,type等等这几个参数当data不写的时候默认是当前被验证的字段的值。传值到php文件中在php文件中处理的时候返回值为 “true”或者false,返回值需要加引号。以下为一个测试案例js的写法var option { rules:{ BaleNo:{ required:true, remote:{ url:checkBaleNoUrl, type:post, dataType:json, } }, ExpressNoList:{ required:true }, }, messages:{ BaleNo:{ required:托盘号不能为空, remote:托盘号已经存在, }, ExpressNoList:{ required:运单号不能为空 }, } };php中方法的写法public function ajaxCheckTrayNo(){ if($_REQUEST[BaleNo]!){ $model M(OrderTray); $map[tray_no] $_REQUEST[BaleNo]; $number $model - where($map) - count(); if($number0){ echo false; }else{ echo true; } }else{ echo false; } }