You need to sign in to do that
Don't have an account?
Sony PSP
Wild card on searching via Text box
Hi folks
please help me, how to I search on textbox via wild card?
ex. is a textbox and I input *h* it should display all wildcards of h, it is needed to use * in textbox for wildcards since in my method below is already a wildcard string query which should be done on textbox instead.
if(accname != '')
{
String strQuery = 'Select Id, FirstName, LastName, '+
'Account.Name,Account.ShippingCountry, '+
'From Contact where Account.Name like \'%'+accname+'%\'';
lstContact = Database.query(strQuery);
}
please help me, how to I search on textbox via wild card?
ex. is a textbox and I input *h* it should display all wildcards of h, it is needed to use * in textbox for wildcards since in my method below is already a wildcard string query which should be done on textbox instead.
if(accname != '')
{
String strQuery = 'Select Id, FirstName, LastName, '+
'Account.Name,Account.ShippingCountry, '+
'From Contact where Account.Name like \'%'+accname+'%\'';
lstContact = Database.query(strQuery);
}
If I am not wrong you have input tag something like this
<apex:inputText value="{!accname}" id="theTextInput"/>
then replace your code snipped with this.
Best Regards,
Amit Ghadage