Jquery EasyUI远程校验,Jquery EasyUI多个自定义校验,EasyUI自定义校验
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
©Copyright 蕃薯耀 2017年3月29日
http://fanshuyao.iteye.com/
方式一:多个自定义校验规则使用键值对的方式
<input value="${orgUnit.pinYin}" class="easyui-textbox w150 jtrim" id="pinYin" name="pinYin" data-options=" required : true, delay : 600, validateOnBlur : false, validType : { minLength : [4], maxLength : [4], remote : ['${pageContext.request.contextPath}/isOrgUnitPinYinExist?orgId=${orgUnit.orgId}','pinYin'] }" />
需要说明的是:remote结果返回
返回字符串"false"表示不通过,返回字符串"true"表示通过
方式二:使用数组的方式
data-options="required:true,validType:['numberText','minLength[11]','maxLength[16]']"
Jquery EasyUI扩展自定义校验规则见:
http://fanshuyao.iteye.com/blog/2351388
官网文档说明:
Defines the field valid type, such as email, url, etc. Possible values are:
1) a valid type string, apply a single validate rule.
2) a valid type array, apply multiple validate rules. The multiple validate rules on a field are available since version 1.3.2.
3) a key/value pairs, the key is the validing type name, the value is an array consisting validating parameters.
Code example:
<input class="easyui-validatebox" data-options="required:true,validType:'url'"> <input class="easyui-validatebox" data-options=" required:true, validType:['email','length[0,20]'] "> <input class="easyui-validatebox" data-options=" required:true, validType:{ length:[10,30], remote:['http://.../action.do','paramName'] } ">
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
©Copyright 蕃薯耀 2017年3月29日
http://fanshuyao.iteye.com/