<select id="s1" onchange="document.all.t1.value+=this.options[this.selectedIndex].value">
<OPTION value="111">111</OPTION>
<OPTION value="222">222</OPTION>
<OPTION value="333">333</OPTION>
</select>
<select id="s2" onchange="document.all.t1.value+=this.options[this.selectedIndex].value">
<OPTION value="111">111</OPTION>
<OPTION value="222">222</OPTION>
<OPTION value="333">333</OPTION>
</select>
<select id="s3" onchange="document.all.t1.value+=this.options[this.selectedIndex].value">
<OPTION value="111">111</OPTION>
<OPTION value="222">222</OPTION>
<OPTION value="333">333</OPTION>
</select>
<br>
<input type="text" id="t1">

解决方案 »

  1.   

    对不起,好象是因为我程序内容比较多的原因,显示不出来呀。
    我把源程序贴在这里,请帮帮忙吧。
    <!--本网站设计、程序、数据结构均属于耐材之窗[http://www.fm086.com]所有-->
    <!-- #include file="inc/cn.asp" -->
    <!-- #include file="inc/function.asp" -->
    <%
    response.buffer=true
    %><html> 
    <head> 
    <title>List</title> 
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
    <% 
    sql = "select * from compsortitem order by sort asc" 
    set rs3 = cn.execute(sql) 
    %> 
    <script language = "JavaScript"> 
    var onecount; 
    onecount=0; 
    subcat = new Array(); 
    <% 
    count = 0 
    do while not rs3.eof 
    %> 
    subcat[<%=count%>] = new Array("<%= trim(rs3("sortitem"))%>","<%= trim(rs3("sort"))%>","<%= trim(rs3("id"))%>"); 
    <% 
    count = count + 1 
    rs3.movenext 
    loop 
    rs3.close 
    set rs3=nothing 
    %> 
    onecount=<%=count%>; function changelocation(locationid) 

    document.myform.smalllocation.length = 0; var locationid=locationid; 
    var i; 
    document.myform.smalllocation.options[0] = new Option('==所选企业的小类==',''); 
    for (i=0;i < onecount; i++) 

    if (subcat[i][1] == locationid) 

    document.myform.smalllocation.options[document.myform.smalllocation.length] = new Option(subcat[i][0], subcat[i][2]); 

    } } 
    </script> 
    <%sql2 = "select * from items order by sortitem asc" 
    set rs2 = cn.execute(sql2) 
    %> 
    <script language = "JavaScript"> 
    var onecount2; 
    onecount2=0; 
    subcat2 = new Array(); 
    <% 
    count2 = 0 
    do while not rs2.eof 
    %> 
    subcat2[<%=count2%>] = new Array("<%= trim(rs2("items"))%>","<%= trim(rs2("sortitem"))%>","<%= trim(rs2("id"))%>"); 
    <% 
    count2 = count2 + 1 
    rs2.movenext 
    loop 
    rs2.close 
    set rs2=nothing 
    %> 
    onecount2=<%=count2%>; function changelocation2(villageid) 

    document.myform.village.length = 0; var villageid=villageid; 
    var j; 
    document.myform.village.options[0] = new Option('==所选企业的项==',''); 
    for (j=0;j < onecount2; j++) 

    if (subcat2[j][1] == villageid) 

    document.myform.village.options[document.myform.village.length] = new Option(subcat2[j][0], subcat2[j][2]); 

    } } 
    </script> </head> 
    <body> 
    <form name="myform" method="post"> 
    分类:<select name="biglocation" onChange="changelocation(document.myform.biglocation.options[document.myform.biglocation.selectedIndex].value)" size="1">   
    <option selected>请选择企业的大类</option> 
    <% sql1 = "select * from compsort order by id asc" 
    set rs1 = cn.Execute (sql1) 
    do while not rs1.eof 
    %> 
    <option value="<%=trim(rs1("id"))%>"><%=trim(rs1("sort"))%></option> <% 
    rs1.movenext 
    loop 
    rs1.close 
    set rs1 = nothing 
    cn.Close 
    set cn = nothing 
    %> 
    </select><select name="smalllocation" onChange="changelocation2(document.myform.smalllocation.options[document.myform.smalllocation.selectedIndex].value)"> 
    <option selected value="">==所有小类==</option> 
    </select><select name="village" size="1"> 
    <option selected>==所有项==</option> 
    </select><br>
    <input type="text" name="T1" size="20">
    </form> </body> 
    </html>
    要求在T1中动态显示三个下拉菜单的内容,不过楼上的贴子的意思会不会导致T1的内容不止是三个呀。
    强烈要求能够解决问题的人跟一贴。
      

  2.   

    帮楼上的改一下..<select id="s1" onchange="compages()">
    <OPTION value="111">111</OPTION>
    <OPTION value="222">222</OPTION>
    <OPTION value="333">333</OPTION>
    </select>
    <select id="s2" onchange="compages()"><OPTION value="111">111</OPTION>
    <OPTION value="222">222</OPTION>
    <OPTION value="333">333</OPTION>
    </select>
    <select id="s3" onchange="compages()">
    <OPTION value="111">111</OPTION>
    <OPTION value="222">222</OPTION>
    <OPTION value="333">333</OPTION>
    </select>
    <br>
    <input type="text" id="t1">
    <script>
    function compages() {
    var vs1=document.all.s1.options[document.all.s1.selectedIndex].value;
    var vs2=document.all.s2.options[document.all.s2.selectedIndex].value;
    var vs3=document.all.s3.options[document.all.s3.selectedIndex].value;
    document.all.t1.value=vs1+vs2+vs3;
    }
    </script>