EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: crosemffet on November 30, 2012, 05:48:29 AM



Title: searchbox validation
Post by: crosemffet on November 30, 2012, 05:48:29 AM
does searchbox has validation?
I'm trying:
$('#tag').searchbox({
   required:true,
   validType:'length[10,15]',
   prompt:'enter the search text',
   searcher:.....
})
and required and validType is not working....
thanks in advance for your support....


Title: Re: searchbox validation
Post by: stworthy on December 01, 2012, 12:19:11 AM
The searchbox is not the form field component. It has not validation feature. If you would like to validate the input value of searchbox, get the text box object of searchbox first and then call 'validatebox' method to create your validation rules.

Code:
$('#tag').searchbox({
   prompt:'enter the search text',
   searcher:.....
}).searchbox('textbox').validatebox({
   required:true,
   validType:'length[10,15]'
});