i want to populate text box on selection of an option from drop down box

as user select an option from drop down box the text box should be populated with that same option text automatically

is it possible to do it in java script or php
drop down box is populated with a "Journal" dababase table
and in option value i m passing its id.
if its possible to pass only id to the text box using java script or php.

i will manage rest of the things.

please help me

thanks in advance.