EasyUI Forum

General Category => General Discussion => Topic started by: featheral on September 30, 2019, 05:14:15 PM



Title: applying multiple validation rules using the valideType attribute
Post by: featheral 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.


Title: Re: applying multiple validation rules using the valideType attribute
Post by: stworthy 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.


Title: Re: applying multiple validation rules using the valideType attribute
Post by: featheral 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,


Title: Re: applying multiple validation rules using the valideType attribute
Post by: stworthy 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']
}
">