1/
function changeValue() {
testForm.t1.value = testForm.s1.value;
}
</script>
<form name="testForm" action="">
<select name="s1" onChange="changeValue()">
<option value="ddddd">1111</option>
<option value="bbbbbb">2222</option>
</select>
<input type="text" name="t1">
</form>
JavaScript实现下拉菜单对文本框赋值的小功能
<script language="javaScript">function changeValue() {
testForm.t1.value = testForm.s1.value;
}
</script>
<form name="testForm" action="">
<select name="s1" onChange="changeValue()">
<option value="ddddd">1111</option>
<option value="bbbbbb">2222</option>
</select>
<input type="text" name="t1">
</form>