How to copy a selected value of list box into a text box in html form?

hi,

i have a list box , a text box and a button in a html form.

list box displays some values, when a user selects a value from the list box and press the button. the selected value should be copied to the text box value.

can any1 give me a html and javascript code to do this facility.

thanks

You extract the form input into a variable, and write it to the text box. Here is a case of writing a text box: Writing to a textbox using javascript.