Jquery EasyUI remote verification, Jquery EasyUI multiple custom verification, EasyUI custom verification, jqueryeasyui

Source: Internet
Author: User

Jquery EasyUI remote verification, Jquery EasyUI multiple custom verification, EasyUI custom verification, jqueryeasyui

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

Copyright Yao March 30, 2017

Http://www.cnblogs.com/fanshuyao/

 

Method 1: Use Key-value pairs for multiple custom validation rules

Html code
  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. />

 

It must be noted that the remote result is returned.

Returns the string "false" to indicate that the request fails. returns the string "true" to indicate that the request passes

 

Method 2: Use Arrays

Html code
  1. Data-options = "required: true, validType: ['numbertext', 'minlength [11] ', 'maxlength [16]']"

 

For details about Jquery EasyUI extension custom validation rules, see:

Http://fanshuyao.iteye.com/blog/2351388

 

 

 

 

Official Website documentation:

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 Yao March 30, 2017

Http://www.cnblogs.com/fanshuyao/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.