Hello,
I'm trying to set the value of a text field to the value of another field after an 'onchange' event. I've decided to take the JavaScript approach rather than an using actionSupport because this should be a quick update.
Here is the Visualforce part:<apex:pageBlockSection title="Account & Contact Details" collapsible="false">Please locate the existing Account: <div style="text-align: center;"><apex:inputField value="{!Lead.Account__c}" id="account" onchange="updateCompanyName()"> </apex:inputField> </div><div style="text-align: center;"> <apex:inputField value="{!Lead.Company}" id="company"></apex:inputField> </div>-----------Here's the function:<script type="text/javascript"> function updateCompanyName(){var accountName = Document.getElementById('{!$Component.account}').value;ar companyName = Document.getElementById('{!$Component.company}').value;companyName.value = accountName.value; }</script>---So in summary, I just want the second field ot be populated with the text from the first field after it's populated. Thanks,ThomasNevermind this thread -- can be closed. Using JQuery to rerender on the client side. Thanks to Bob Buzzard (as usual)!https://developer.salesforce.com/forums/?id=906F0000000AahBIAS