EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
September 14, 2025, 06:24:43 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
Dynamically change the validType of a easyui-validatebox...
Pages: [
1
]
« previous
next »
Print
Author
Topic: Dynamically change the validType of a easyui-validatebox... (Read 14926 times)
elcidofauy
Newbie
Posts: 11
Dynamically change the validType of a easyui-validatebox...
«
on:
July 16, 2014, 11:06:40 PM »
Dear All,
I'm trying to figure out how to dynamically set the validType of a easyui-validatebox. In this particular situation I have combo-box and when various values are selected then I need to change the validType of the text box. For example lets say I select value 1 from the combo-box then the text box can have free text (no validation), however if I select value 2 from the combo the textbox needs to be a valid URL.
I have managed to write the code to the point where I have detected the combo box change but I am unable to figure out how to change the validType of the textbox.
Appreciate your help!
Logged
aswzen
Sr. Member
Posts: 287
Indonesian
Re: Dynamically change the validType of a easyui-validatebox...
«
Reply #1 on:
July 16, 2014, 11:23:53 PM »
var status = 0;
if (status == 1 ) {
$('#textbox').validatebox({
validType: 'url'
});
} else {
$('#textbox').validatebox({
validType: 'number'
});
}
Logged
Regards,
Sigit
- Indonesian jEasyUI Facebook page :
https://www.facebook.com/groups/jeasyuiid/
elcidofauy
Newbie
Posts: 11
Re: Dynamically change the validType of a easyui-validatebox...
«
Reply #2 on:
July 16, 2014, 11:54:55 PM »
Hi Aswzen,
Awesome!! Yes indeed this works... I also note by setting validType: '' (empty string) removes any previous assigned validTypes...
Many Thanks...
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...