Jquery EasyUI远程校验,Jquery EasyUI多个自定义校验,EasyUI自定义校验

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

©Copyright 蕃薯耀 2017年3月30日

http://www.cnblogs.com/fanshuyao/

 

方式一:多个自定义校验规则使用键值对的方式

Html代码  收藏代码
  1. <input value="${orgUnit.pinYin}" class="easyui-textbox w150 jtrim" id="pinYin" name="pinYin"   
  2.     data-options="  
  3.         required : true,  
  4.         delay : 600,  
  5.         validateOnBlur : false,  
  6.         validType : {  
  7.             minLength : [4],  
  8.             maxLength : [4],  
  9.             remote : ['${pageContext.request.contextPath}/isOrgUnitPinYinExist?orgId=${orgUnit.orgId}','pinYin']  
  10.         }"  
  11.     />  

 

需要说明的是:remote结果返回

返回字符串"false"表示不通过,返回字符串"true"表示通过

 

方式二:使用数组的方式

Html代码  收藏代码
  1. 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月30日

http://www.cnblogs.com/fanshuyao/

posted @ 2017-03-30 08:58  蕃薯耀  阅读(1478)  评论(1编辑  收藏  举报