EasyUI Forum
April 29, 2024, 01:56:03 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: applying multiple validation rules using the valideType attribute  (Read 6063 times)
featheral
Newbie
*
Posts: 14


View Profile
« on: September 30, 2019, 05:14:15 PM »

Hi.
Would appreciate guidance on how to set >1 validation rules on a form input, using the 'validType' attribute (not 'data-options').
Thanks.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 02, 2019, 05:17:58 PM »

The 'validType' attribute can only accept one validation rule, please use 'data-options' attribute and apply 'validType' property with multiple validation rules.
Logged
featheral
Newbie
*
Posts: 14


View Profile
« Reply #2 on: October 02, 2019, 11:52:54 PM »

Thanks.
In the "validate box" documentation I see the following use of the 'required' attribute:

<input id="rpwd" name="rpwd" type="password" class="easyui-validatebox"
    required="required" validType="equals['#pwd']">

Is that actually how it's meant to-be specified?

Could you point me to the documentation specifying the use of this attribute, plus all builtin validations?
Thanks,
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: October 04, 2019, 04:23:36 PM »

The multiple validation rules should be set in 'data-options' attribute. Please look at this code below.

Code:
<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']
}
">
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!