function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Salesforce GeevanSalesforce Geevan 

i tried to search values from a object without command button,while typing in the textbox itself,it should return the record..

My code is 
Controller:
public class  SearchNoButton{
public String find { get; set; }
public list<Customer__c> cuslist{get;set;}
public String searchtext{get;set;}

public string s ;
public void find()
{
cuslist=new list<Customer__c>();
s  = '%' + searchtext  + '%'; 

cuslist=
[select Name,Name__c,Status__c,age__c from Customer__c where Name__c LIKE : s];


}

}

visualforce page:
<apex:page controller="SearchNoButton" action="{!find}">
<apex:pageblock title="search Customer">
<apex:form Rendered="{!find}">
name  <apex:inputtext value="{!searchtext}" Rendered="{!find}"/>
</apex:form>
  </apex:pageblock>
<table border='1' width='100%'>
  <tr>
      <th>name</th><th>customername</th><th>Status</th><th>AGE</th>
  </tr>
  <apex:repeat value="{!cusList}" var="a">
  <tr>
      <td>{!a.Name}</td>
      <td>{!a.Name__c}</td>
      <td>{!a.Status__c}</td>
      <td>{!a.Age__c}</td>
  </tr>
  
  </apex:repeat>

  </table>
</apex:page>
Marcilio SouzaMarcilio Souza
Hello,

Try to follow this example:
http://sfdcsrini.blogspot.com/2014/08/simple-ajax-example-using-visualforce.html
 
<apex:page controller="AjaxWildcardController">
    <apex:form >
        <apex:pageBlock >
            Type Account Name Here :
            <apex:inputText value="{!inputtext}" >
            <apex:actionSupport action="{!actionSupMethod}" event="onkeyup" reRender="outptText" />
            </apex:inputtext>
        </apex:pageBlock>  
        
        <apex:pageblock >
            <apex:pageblocktable value="{!accList}" var="acc" id="outptText">
                <apex:column value="{!acc.name}"/>
                <apex:column value="{!acc.accountnumber}"/>
            </apex:pageblocktable>
        </apex:pageblock>
    </apex:form>
</apex:page>
 
public class AjaxWildcardController {
Public string inputtext{get;set;}
    Public List<account> accList{get;set;}
    Public boolean flagshow{get;set;}
    Public AjaxWildcardController(){
    flagshow = false;
    }    
    
    Public void actionSupMethod(){
     system.debug('inputtext-->'+inputtext);
    
      accList = database.Query('select name,accountnumber from account where name like '+'\''+'%'+inputtext+'%'+'\'');
    }
}

Please, If this anwser help you mark as the best