日期:2014-05-17 浏览次数:20761 次
<script language = "JavaScript"> var onecount; onecount=0; subcat = new Array(); subcat[0] = new Array("操作系统","1","1"); subcat[1] = new Array("网络安全","1","2"); subcat[2] = new Array("软件破解","1","3"); subcat[3] = new Array("心情日记","2","4"); subcat[4] = new Array("笑话幽默","3","5"); subcat[5] = new Array("灌水用帖","3","6"); onecount=6; function changelocation(locationid) { document.myform.Nclassid.length = 0; var locationid=locationid; var i; for (i=0;i < onecount; i++) { if (subcat[i][1] == locationid) { document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]); } } } </script> <form method="POST" name="myform""> <select name="classid" onChange="changelocation(document.myform.classid.options[document.myform.classid.selectedIndex].value)" size="1"> <option class=input selected value="1">电脑相关</option> <option class=input value="2">情感频道</option> <option class=input value="3">休闲娱乐</option> </select> <select name="Nclassid" class=input> <option class=input selected value="1">操作系统</option> <option class=input value="2">网络安全</option> <option class=input value="3">软件破解</option> </select> </form>
------解决方案--------------------
太多了
http://www.google.com.hk/search?client=aff-cs-maxthon&forid=1&ie=utf-8&oe=UTF-8&hl=zh-CN&q=%E7%BA%A7%E8%81%94%E8%8F%9C%E5%8D%95
------解决方案--------------------
用JQUERY
做級聯更方便 更容易。。。
------解决方案--------------------
JS啊,很简单的。。
------解决方案--------------------
................................
------解决方案--------------------
用JS很容易就实现了
------解决方案--------------------
最好就是用Ajax,这是它的特性之一。
------解决方案--------------------
先找个例子看下,一会就弄明白了
------解决方案--------------------
用js就好了~~~
用js的一个类似于map的集合做
很好做的