Possible Duplicate:
Form input value based on option value selected
I have a dropdown list. I want that whenever I select a value from the dropdown, the selected value is automatically copied into a text box in the same form. I would like to make use of jQuery and not simply other, plain Javascript methods.
The code for the form is:
<s:form action="okadddqs" method="post" cssClass="text">
<s:select label="Correct Option :"
id="opc"
name="opc"
list="#@java.util.LinkedHashMap@{'One':'One', 'Two':'Two','Three':'Three','Four':'Four','Five':'Five'}"/>
<s:textfield label="Choosed Option" id="cname" name="cname"/>
<s:submit value="Submit now"/>
I wnat cname to be filled automatically with the selected value of opc. How do I implement this?
DEMO