这个联动菜单应该怎么用 <select name="sel" id="sel" onChange="changeselect1(this.value)" > changeselect1()你还缺少一个js代码。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <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>是这段,加上了也没效果 你的js有问题, $count是php变量在js中应该写成这样'<?=$count?>',你的$count从哪儿来的呢?原来只是记录数,现在怎么又充当数组了? php 不鼓励使用 结束标签,为什么? PHP远程获取图片并保存本地的问题 请教各位 php实现rsa算法 使用这种方法如果每天增加1000条数据会不会怠慢 关于html+css的一个小问题 请问如何在在url地址中传递带有&符号的参数 怎样用PHP生成带图片的Excel!!!狂急在线狂等 很麻烦的问题(新手) VxWorks上的web开发,有没有类似于php之类的脚本语言 一个很有争议的问题 linux安装php问题 PHPexcel生成文件下载问题。
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>是这段,加上了也没效果