就是两个select表联动,例如,当一个select选了省份后,另一个select就自动调出相应的城市名。

解决方案 »

  1.   

    你要的是javascript的代码吗,明天给你一份。
      

  2.   

    请参照
    http://www.gaocan.com/train2.jsp
      

  3.   

    http://expert.csdn.net/Expert/topic/1293/1293730.xml?temp=.057522
      

  4.   

    我又给你写了个例子(绝对原创):在例子中,你可以把数据一次性读入数组啊,不完善的地方你自己改改。
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>连动的例子</title>
    </head><body>
    <form name="form1" method="post" action=""> 
    <select name="select_province" onChange="ChangChilds();"></select>
    <select name="select_city"></select>
    </form>
    </body>
    <script language="JavaScript">
    <!--
    //对象变量,全局变量
    var MyFatherObject=form1.select_province;
    var MySonObject=form1.select_city;//父组
    var ArrayFather=new Array("北京","湖北","江苏");//子组
    var ArrayChild=new Array();
    ArrayChild["北京"]=new Array("通县0","通县1","通县2","通县3","通县4","通县5");
    ArrayChild["湖北"]=new Array("武汉0","武汉1","武汉2","武汉3");
    ArrayChild["江苏"]=new Array("南京0","南京1","南京2","南京3");//缺省载入
    for(var k=0;k<ArrayFather.length;k++){
    MyFatherObject.options[k]=new Option(ArrayFather[k],ArrayFather[k]);
    }//连动函数
    function ChangChilds(){
    var Father=MyFatherObject.options[MyFatherObject.selectedIndex].value;

    MySonObject.length=0;

    for(var i=0;i<ArrayChild[""+Father+""].length;i++){
    MySonObject.options[i]=new Option(ArrayChild[""+Father+""][i],ArrayChild[""+Father+""][i]);
    }
    }
    -->
    </script>
    </html>
      

  5.   

    谢谢laosan(老三),我那天分析了javascript代码,然后在根据规则自己改了动态选择内容,而不是事先列好的数组,还比较成功。好了,给分。