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
Charlie Cox 1Charlie Cox 1 

Real time results bar salesforce

I want to develope a search which displays results in a list that generates as a user inputs a string into an inputText field. My code is below.

<apex:inputText value="{!companyName}" style="width:200px">
     <apex:actionSupport event="onchange" action="{!searchSort}" reRender="pbt2"/>
</apex:inputText>

<apex:outputPanel id="pbt2">
  <apex:outputPanel rendered="{!showSearchResults}">
       results go here
  </apex:outputPanel>
</apex:outputPanel>

The problem is that I inputText does not display "results goes here" as you type, but rather only when you click somewhere else isn't the input box.
Is there a way to make something render as soon as you type a character or no? Also if there is a better way to do this please feel free to let me know.
AshlekhAshlekh
Hi,

When some one type in text box on that time you are hitting a request to server and when user enter a another alphabet in text box then again hit a request to server by this way your server get busy, when you hit second request it may be possible the first request will not be completed as your are htting reqest frequently that cause a problem.

You have to stop use to enter another alphabet till first request is not completed or you can do this by javascript 
bob_buzzardbob_buzzard
This is because you are relying on the onchange event, which only fires when the user completes their changes in the field.  You want to use the onkeyup event, as this will fire every time the user types a character.