[SalesForce] Onchange Javascript to update input field on VF page When an item is selected on Selected list

I created a VF page with input fields of Account Object.
I created a select list on Vf page using controller.
I want to update the input field(selected__c : datatype--text) with selected option in select list.

So My question is how to write java script to make it work ?

Best Answer

We can do this using two different approach :

  1. Using Actionfunction of VF and then rerender the outputPanel containing our text field https://developer.salesforce.com/forums/?id=906F000000096tTIAQ
  2. using Javascript to input the text in text input https://stackoverflow.com/questions/1085801/get-selected-value-in-dropdown-list-using-javascript
Related Topic