+ Start a Discussion

Auto population of other field, based on selection of look-up fields


    I have a visualforce page, in which two fields are present. One is 'Account Name' which is a look up on Account object, other field is a textbox named as Account number.

Is it possible on select of a particular account, automatically Account number also get populated to the input TextText.







You could try putting a javascript event (onchange) on the  Account Name.  When that fires you could call an actionFunction action from the javascript you run.  The action will set the other value in your controller.  You could even use rerender to then refresh the other field.


If you want to do the population from javascript you could just get the id of the second field and set the value.


If you search 'actionFunction' in the dev guide there are some nice examples.


Hope this helps.





           I have a similar kind of requirement i want to populate one text field value in visualforce page by selecting another field(by clicking on enter key) in the same page.


Your requirement is almost similar, did you get any solution for this. If yes then please help me out.



Thanks & regards,

Raju Deep