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
SurjenduKSurjenduK 

Ajax question in VisualForce.

Code:
<apex:page id="myPage">
<apex:form id="myForm">
<apex:pageBlock>

<apex:outputPanel>
<apex:inputText id="accName"></apex:inputText>
<apex:actionSupport event="onkeydown" rerender="detail">
<apex:param name="val" value="document.getElementById('{!$Component.accName}').value"/>
</apex:actionSupport>
</apex:outputPanel>


<apex:outputPanel id="detail">
<apex:actionStatus >
<apex:facet name="stop">
<apex:outputText value="{!$CurrentPageReference.parameters.val}"></apex:outputText>
</apex:facet>
</apex:actionStatus>
</apex:outputPanel>

</apex:pageBlock>
</apex:form>
</apex:page>

Whenever i enter some value in the textfield the detail panel renders
document.getElementById('{!$Component.accName}').value

I want the value of

document.getElementById('{!$Component.accName}').value
 and not
document.getElementById('{!$Component.accName}').value.

Also the ajax function in not getting called in every key stroke. It just gets called only once at first.
How to solve this?