<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<form name="form1">
<select name="select1" onchange="document.all.form1.text1.value=this.options[this.selectedIndex].text">
  <option>1</option>
  <option>2</option>
  <option>3</option>
  <option>4</option>
  <option>5</option>
  <option>6</option>
</select>
<input name="text1" type="text" value="1" />
</form>
</body>
</html>

解决方案 »

  1.   

    告诉你思路自己写吧
    在联动的两个下拉列表上面添加onchange事件
    变化的时候给文本框付值
    比如说
    function getvalue()
    {
      document.getElementById("文本框的id").value=document.getElementById("下拉列表的id").selected.
    }
    你自己修改一下语法。
    第二个如果想要放到同一个文本框中的话就需要在文本框原有值上加新值了。字符串连接就可以了。
      

  2.   

    onChange事件里面还负责小类的填充的
    function change()
    {
    1.根据所选值填充小类
    2.获取大类得值
    }
    小类的下拉列表也需要添加onchange事件
    这个里面只需要写获取小类得值就可以了
      

  3.   

    我在 function changelocation内加了一行
       document.myform.txt_sel.value = document.myform.btype.value
    能够在文本框txt_sel中得到select的index,但能不能仿照得出select的实际值?
      

  4.   

    这个问题解决了么。如果没有解决。
    我这里有解决的思路不过还是希望你自己来实现。
    使用一个for循环了遍历下拉列表控件
    然后 if 控件的某一项是被选中的
    使用innerText属性去获取所选中的项的文本