Title: Dynamically change the validType of a easyui-validatebox... Post by: elcidofauy 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! Title: Re: Dynamically change the validType of a easyui-validatebox... Post by: aswzen on July 16, 2014, 11:23:53 PM var status = 0;
if (status == 1 ) { $('#textbox').validatebox({ validType: 'url' }); } else { $('#textbox').validatebox({ validType: 'number' }); } Title: Re: Dynamically change the validType of a easyui-validatebox... Post by: elcidofauy 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... :) |