根据你的要求改了,看一下!可不可以用<script language="javascript">
<!--var subval = new Array();
subval[0] = new Array('01','1','01','new1','种类')
subval[1] = new Array('01','1','02','new2','种类')
subval[2] = new Array('01','1','03','new3','种类')
subval[3] = new Array('01','2','008','0.08mm','直径')
subval[4] = new Array('01','2','009','0.09mm','直径')
subval[5] = new Array('02','1','10','EI','种类')
subval[6] = new Array('02','1','20','EE','种类')
subval[7] = new Array('02','2','83','8.3型','型式')
subval[8] = new Array('02','2','13','13型','型式')function move(i)
{
if(document.form2.s2.selectedIndex ==document.form2.s2.length-1)
 return
document.form2.s2.selectedIndex++;
add_option(i)}function add_option(i) 
{
for(j=0;j<i;j++)
{document.form2.s3.options[j] = new Option(j+1,j);
}
}function changeselect2(sub1)
{
document.form2.s1.disabled = true;
document.form2.s2.disabled = true;
document.form2.s2.length = 0;for (i=0; i<subval.length; i++)
{
if (subval[i][0] == sub1)
{document.form2.s2.options[document.form2.s2.length] = new Option(subval[i][1], subval[i][1]);}
}
document.form2.s3.length = 0;
}function changeselect3(sub1,sub2)
{
document.form2.s3.length = 0;
for (i=0; i<subval.length; i++)
{
if ((subval[i][0] == sub1) & (subval[i][1] == sub2))
{document.form2.s3.options[document.form2.s3.length] = new Option(subval[i][2], subval[i][2]);}
}
}
function changeselect4(sub3)
{for (i=0; i<subval.length; i++)
{
if (subval[i][1] == sub3)
{
document.form2.desc.value=document.form2.desc.value+(subval[i][4]);
i=subval.length
}}}
function changeselect5(sub1,sub2)
{for (i=0; i<subval.length; i++)
{
if ((subval[i][0] == sub1)&(subval[i][1] == sub2))
{
document.form2.desc.value=document.form2.desc.value+(subval[i][3]);
i=subval.length
}}}//-->
</script><form name="form2"><table width="400" border="0">
  <tr>
    <td valign="top">选项: </td>
    <td valign="top">&lt;1&gt;
      <select name="s1" id="s1" onChange="changeselect2(this.value);fullname.value=this.value;desc.value=this.options[this.selectedIndex].indexKey;other1.value=this.value;add_option(3);">
<option>==请选择==</option>
<option value="01" indexKey="钢线">01</option>
<option value="02" indexKey="铁芯">02</option></select>&nbsp;</td>
    <td valign="top">&lt;2&gt;
      <select name="s2" onChange="add_option();changeselect3(document.form2.s1.value,this.value);other.value=this.value;changeselect4(this.value);fullname.value=fullname.value+this.value"> 
</select>&nbsp;</td>
    <td>&lt;3&gt;
      <select name="s3" size="10" id="s3" multiple onChange="move(4);changeselect5(document.form2.other1.value,document.form2.other.value);fullname.value=fullname.value+this.value"> 
</select>
&nbsp;</td>
  </tr>
  <tr>
    <td>编号: </td>
    <td colspan="3"><input name="desc" type="text" id="desc3"></td>
  </tr>
  <tr>
    <td>描述: </td>
    <td colspan="3"><input name="fullname" type="text" id="fullname3">
      <input name="other" type="hidden" id="other5">
      <input name="other1" type="hidden" id="other13"></td>
  </tr>
</table>
</form>

解决方案 »

  1.   

    kkk8000(小菜头),谢谢你..但还是不对,请再帮帮忙<1>选了01后,虽<2>自动为第一个值,但它没有把'种类'和'01'分别写到编号和描述内,
    <3>的应该是:01,02,03 而且在<3>内选了好几次后,<2>才跑么第二值,当<2>值为2时<3>的值应该是:008,009 同样,在<2>跳到第二值时'直径'和'2'应该分别写到编号和描述内.请把我的copy下来成为htm测一下,就知道了..谢谢...
      

  2.   

    kkk8000(小菜头),你好.我是菜鸟,请帮我改好行吗?非常感谢!!!
      

  3.   

    我给你写个代码,你要是看明白了,多少级连都不是问题!这是我前几天用php做的。
    test1.php
    <script id=aaa></script>
    <script>
    function readSelect(){
    document.test.select.disabled=true;
    document.test.select2.disabled=true;
    for(i=document.all("select2").options.length-1;i>-1;i--){
      document.all("select2").options.remove(i);
    }
    document.all('select2').options.add(new Option('下载中……',''));
    aaa.src='test.php?id='+document.test.select.value;
    }
    </script>
    <body>
    <form action="" name="test">
    <select name="select" onChange="readSelect();">
    <option>请选择……</option>//////////这里的数据你可以从数据库里面读</select>
    <select name="select2">
    <option>请选择……</option>
    </select>
    </form>
    </body>
    </html>
    test.php
    <?
    require('inc/cnn.php');
    $id=$_REQUEST['id'];
    echo "for(i=document.all('select2').options.length-1;i>-1;i--){
      document.all('select2').options.remove(i);
      }";$sql="select * from employee where department_id='$id'";
    $rs=mysql_query($sql,$cn);
    while($ls=mysql_fetch_array($rs)){
    echo "document.all('select2').options.add(new Option('$ls[name]','$ls[id]'));";
    }
    echo "document.test.select.disabled=false;
      document.test.select2.disabled=false;";
    ?>
    记得给我加分~
      

  4.   

    在51js.com内有人帮我已解决了.楼上的,我写的是asp啊..php看不懂啊,不过还是谢谢你.