How to get the value that is selected in the dropdown box to a text box. I have a text box and a drop down box in which village names are listed.If the selection is changed that value should reflect on text box.Please help me.
This is a Javascript 101 question! I shouldn't answer but ....
<script type="text/javascript">
function selectChange(val)
{
document.getElementById("text_id").value = val;
}
</script>
<form>
<input id="text_id" value="" type="text" size="10" />
<br />
<select id="select_id" onChange="selectChange(this.value);">
<option value="">-- Select --</option>
<option value="val1">val1</option>
<option value="val2">val2</option>
<option value="val3">val3</option>
</select>