<select name="sel" id="sel" onChange="changeselect1(this.value)" > changeselect1()
你还缺少一个js代码。

解决方案 »

  1.   

    <script type="text/javascript">
      function changeselect1(locationid) 

    document.form1.selIn.length = 0; //初始化下拉列表 清空下拉数据 
    document.form1.selIn.options[0] = new Option('==请选择==',''); //给第一个值 
    for (i=0; i<$count.length; i++) //legth=20 

    if ($count[i][0] == locationid) //[0] [1] 第一列 第二列 
    {document.form1.selIn.options[document.form1.selIn.length] = new Option($count[i][1], $count[i][2]);

    //建立option 
    //第一次 length=1 因为有==请选择== 
    //i=9时 length= 10 值有11个 因为从0数起 subcat[i][0] == locationid屏蔽了再写 

    }    </script>是这段,加上了也没效果
      

  2.   

    你的js有问题, $count是php变量在js中应该写成这样'<?=$count?>',你的$count从哪儿来的呢?原来只是记录数,现在怎么又充当数组了?