I am trying to auto populate the value of lookup field to text field in the visualforce page. As soon as I select the value of lookup field from the list the value as it get populated in the lookup field also it need to get populated in the text field which I have created in the visualforce page. Can I achieve this functionality ?
Here Daily_Record__c is my custom object I want to auto populate the value of <apex:inputfield value="{!Daily_Record__c.Username__c}"/>
in to the <apex:inputText value="{!strAccSearchString}"/>
so what should I do ?
apex code :-
<apex:page Standardcontroller="Daily_Record__c" extensions="ctrlSearch">
<apex:form >
<apex:inputfield value="{!Daily_Record__c.Username__c}"/>
<apex:inputText value="{!strAccSearchString}"/>>
<apex:commandButton value="Search" action="{!SearchAccountRec}"/>
<apex:pageBlock rendered="true" title="Search Result">
<apex:pageBlockTable value="{!lstAccount}" var="acc">
<apex:column >
<apex:facet name="header">Name</apex:facet>
<apex:outputLink value="/{!acc.id}">{!acc.Username__c}
</apex:outputLink>
</apex:column>
<apex:column >
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock rendered="{!If(lstAccount.size==0 && isResultDisplay ==
true,true,false)}" title="Search Result">
<apex:pageblockSection >
<apex:outputLabel value="No Result Found"></apex:outputLabel>
</apex:pageblockSection>
</apex:pageBlock>
</apex:form>
</apex:page>