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
saimadhusaimadhu 

display text in input field

hi,i have a label and input box.if i enter a name on the input it  is displaying  records related to that name.but when i enter the name and hit enter the name is not displaying on that label.it goes balnk ( displaying the records).

how to retain the entered value in the input box.

here is my code.

 

<apex:toolbarGroup location="left" style="padding-top:6px;">

<script type="text/javascript">
function doSearch() {
var t = setTimeout(function() {
searchServer(document.getElementById("pgName").value);
}, 500);
}
</script>

<apex:actionFunction name="searchServer" action="{!runSearch}" status="status2" rerender="soqlDebug,errors,pbtSearch">
<apex:param name="pgName" value="" />
</apex:actionFunction>

<label for="Product Search" style="color:#666;">Product Group Search</label>
<input name="Product Search" id="pgName" onkeyup="doSearch();" type="text" style="width:220px;" />

</apex:toolbarGroup>

 

 

 

 

 

 

 

 

S91084S91084

By looking at your code, it seems like you are returning the search results on KeyUp. When u hit enter you are submitting the page to the server, there is no action associated with the "enter" functionality. Your onKeyUp works as long as u type something in the input box and aslong as that component is in focus. When you it enter, teh page is submitted and there is no action performed. That is the reason it is not displaying the search results on the when u hit enter.

saimadhusaimadhu

yes, you are correct.but i wanted to display the entered product group on that textbox.when i click enter it reoads the page and displaying search results but the textbox was empty. it should display on that box.

how can i?