<script language = "JavaScript"> 
sall=new Array();
sall[0]=new Array("泉州","1","1");
sall[1]=new Array("厦门","1","2");
sall[2]=new Array("福州","1","3");
sall[3]=new Array("石狮","1","4");
sall[4]=new Array("武汉","2","5");
sall[5]=new Array("沙市","2","6");
sall[6]=new Array("孝感","2","7");
sall[7]=new Array("信阳","3","8");
sall[8]=new Array("郑州","3","9");
sall[9]=new Array("南阳","3","10");
function changeselect(selvalue)  
   { 
      document.myform.Nclassid.length=0;  
      var selvalue=selvalue;
      var i;
      for(i=0;i<sall.length;i++) 
    {
        if(sall[i][1]==selvalue) 
            {
    var newOption1=new Option(sall[i][0],sall[i][2]);
    document.all.Nclassid.add(newOption1);
        }
    }
}
</script> 
<form method="post" name="myform" action="ru_query.asp"> 
<select name="classid" onChange="changeselect(document.myform.classid.options[document.myform.classid.selectedIndex].value)" size="1"> 
<option selected value="">未指定条件</option> 
<option value='1'>福建省</option>
<option value='2'>湖北省</option>
<option value='3'>河南省</option>
</select> 
<select name="Nclassid"> 
<option selected value="">未指定</option> 
</select>

解决方案 »

  1.   

    我有现成的代码,但是数据在ORACLE数据库中,你要是想要就告诉我你的信箱地址。
      

  2.   

    我也要啊。。[email protected]谢谢啦,,楼上的。。
      

  3.   

    我的贴分两部分第一部分:二级联动
    <html>
    <head>
    <title>级联下拉菜单</title>
    </head>
    <body onload="changelocation(document.myform.cateid.options[document.myform.cateid.selectedIndex].value)">
    <form name="myform" method="post" action="Publish.asp" target="_top">
    <select name="cateid" size="1">
                    <option selected value='1' name=cateid>网络软件</option>
                    <option  value='2' name=cateid>系统工具</option>
                    <option  value='3' name=cateid>应用软件</option>
                    <option  value='6' name=cateid>多媒体类</option>
                    <option  value='10' name=cateid>安全相关</option>
                    <option  value='11' name=cateid>教育教学</option>
                  </select>
    <input type=button value=">>" onClick="changelocation(document.myform.cateid.options[document.myform.cateid.selectedIndex].value)">
    <select name="subcateid" size="1">
    </select>
    <SCRIPT language = "JavaScript">
        var onecount;
        onecount=0;
        subcat = new Array();
            
        subcat[0] = new Array("主页浏览","3","1");
        subcat[1] = new Array("书签工具","3","5");
        subcat[2] = new Array("FTP 工具","1","12");
        subcat[3] = new Array("系统增强","2","13");
        subcat[4] = new Array("系统设置","2","14");
        subcat[5] = new Array("系统备份","2","15");
        subcat[6] = new Array("桌面工具","2","16");
        subcat[7] = new Array("压缩解压","3","21");
        subcat[8] = new Array("文件管理","3","22");
        subcat[9] = new Array("文件更名","3","24");
        subcat[10] = new Array("电子阅读","3","27");
        subcat[11] = new Array("媒体播放","6","42");
        subcat[12] = new Array("音频处理","6","43");
        subcat[13] = new Array("下载工具","1","60");
        subcat[14] = new Array("系统安全","10","61");
        subcat[15] = new Array("网吧管理","10","63");
        subcat[16] = new Array("网络安全","10","64");
        subcat[17] = new Array("教育管理","11","66");
        subcat[18] = new Array("邮件工具","1","72");
        onecount=19;
        changelocation(1);function changelocation(locationid)
        {
        document.myform.subcateid.length = 0;     var locationid=locationid;
        var i;
        for (i=0;i < onecount; i++)
            {
                if (subcat[i][1] == locationid)
                { 
                    document.myform.subcateid.options[document.myform.subcateid.length] = new Option(subcat[i][0], subcat[i][2]);
                }        
            }
            
        }    
    </SCRIPT>
    </form>
    </body>
    </html>
      

  4.   

    第二部分:全国的地区<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD><BODY>
    <form action="ddnsqd_cl.asp" method=post name=ddnsqd>
    <td><SELECT name=xSXJS style="BACKGROUND-COLOR: #90E0FF; WIDTH: 50pt;" onchange="changes(this.value,'J');">
        <OPTION value=""></OPTION>
       <OPTION value="北京">北京</OPTION>
       <OPTION value="上海">上海</OPTION>
       <OPTION value="湖北">湖北</OPTION>
       <OPTION value="辽宁">辽宁</OPTION>
       <OPTION value="陕西">陕西</OPTION>
       <OPTION value="四川">四川</OPTION>
       <OPTION value="江苏">江苏</OPTION>
       <OPTION value="广东">广东</OPTION>
       <OPTION value="天津">天津</OPTION>
       <OPTION value="甘肃">甘肃</OPTION>
       <OPTION value="重庆">重庆</OPTION>
       <OPTION value="河北">河北</OPTION>
       <OPTION value="山东">山东</OPTION>
       <OPTION value="山西">山西</OPTION>
       <OPTION value="河南">河南</OPTION>
       <OPTION value="吉林">吉林</OPTION>
       <OPTION value="黑龙江">黑龙江</OPTION>
       <OPTION value="安徽">安徽</OPTION>
       <OPTION value="浙江">浙江</OPTION>
       <OPTION value="江西">江西</OPTION>
       <OPTION value="福建">福建</OPTION>
       <OPTION value="贵州">贵州</OPTION>
       <OPTION value="广西">广西</OPTION>
       <OPTION value="海南">海南</OPTION>
       <OPTION value="云南">云南</OPTION>
       <OPTION value="内蒙古">内蒙古</OPTION>
       <OPTION value="青海">青海</OPTION>
       <OPTION value="新疆">新疆</OPTION>
       <OPTION value="宁夏">宁夏</OPTION>
       <OPTION value="西藏">西藏</OPTION>
       <OPTION value="湖南">湖南</OPTION>
        </SELECT></td>
      <td><SELECT name=xSXJI style="BACKGROUND-COLOR: #90E0FF; WIDTH: 50pt;" onchange="changei(document.all.xSXJS.value,this.value,'J');"></SELECT></td>
      <td><SELECT name=xSXJX style="BACKGROUND-COLOR: #90E0FF; WIDTH: 50pt;" onchange="changex(this.value,'J');"></SELECT></td>
      </form>  <SCRIPT LANGUAGE=javascript>
    <!--
    function changeg(guo,fx)
    {
      document.all.item('SX'+fx+'G').value=guo;
      document.all.item('SX'+fx+'S').value='';
      document.all.item('SX'+fx+'I').value='';
      document.all.item('SX'+fx+'X').value='';
      document.all.item('xSX'+fx+'S').value='';
      changes('',fx);
    }
    function changes(sheng,fx)
    {
      var pos,sh,s,i,op;
      document.all.item('xSX'+fx+'I').options.length=0;
      document.all.item('xSX'+fx+'X').options.length=0;
      if(sheng!='')
      {
        sh=document.all.shi.value;
        pos=sh.indexOf('|'+sheng+'|');
        if(pos>=0)
        {
          pos=pos+('|'+sheng+'|').length;
          sh=sh.substring(pos,sh.indexOf('|',pos));
          //将数据导入下拉框中
          s=sh.split(' ');
          for(i=0;i<s.length;i++)
          {
            op=document.createElement('option');
            op.text=s[i];
            op.value=s[i];
            document.all.item('xSX'+fx+'I').add(op);
          }
        }
      }
    }
    function changei(sheng,shi,fx)
    {
      var pos,po,sh,s,i,op;
      document.all.item('xSX'+fx+'X').options.length=0;
      if(sheng!='')
      {
        sh=document.all.xian.value;
        pos=sh.indexOf("|"+sheng+"|");
        if(pos>=0)
        {
          pos=pos+("|"+sheng+"|").length;
          po=sh.indexOf("|"+shi+"!",pos);
          if(po>=pos)
          {
            po=po+("|"+shi+"!").length;
            sh=sh.substring(po,sh.indexOf("|",po))
            //将数据导入下拉框中
            s=sh.split(" ");
            for(i=0;i<s.length;i++)
            {
              op=document.createElement("option");
              op.text=s[i];
              op.value=s[i];
              document.all.item('xSX'+fx+'X').add(op);
            }
          }
        }
      }}
    function changex(xian,fx)
    {}
    function showydxx(djsx,dllb)
    {
      if(dllb=='备份电路')
      {
        ydxx.style.display='';
        document.all.item('SAYDDBH').style.backgroundColor=document.all.item('SAYDDH').style.backgroundColor=document.all.item('SAYDLDH').style.backgroundColor=document.all.item('SAYJKSL').style.backgroundColor=document.all.item('SAYJZXH').style.backgroundColor=document.all.item('SAYYZXH').style.backgroundColor=document.all.item('SAYDLLY').style.backgroundColor='';
        document.all.item('SAYDDBH').disabled=document.all.item('SAYDDH').disabled=document.all.item('SAYDLDH').disabled=document.all.item('SAYJKSL').disabled=document.all.item('SAYJZXH').disabled=document.all.item('SAYYZXH').disabled=document.all.item('SAYDLLY').disabled=false;
      }
      else if(djsx!='新装')
      {
        ydxx.style.display='';
        document.all.item('SAYDDBH').style.backgroundColor=document.all.item('SAYDDH').style.backgroundColor=document.all.item('SAYDLDH').style.backgroundColor=document.all.item('SAYJKSL').style.backgroundColor=document.all.item('SAYJZXH').style.backgroundColor=document.all.item('SAYYZXH').style.backgroundColor=document.all.item('SAYDLLY').style.backgroundColor='';
        document.all.item('SAYDDBH').disabled=document.all.item('SAYDDH').disabled=document.all.item('SAYDLDH').disabled=document.all.item('SAYJKSL').disabled=document.all.item('SAYJZXH').disabled=document.all.item('SAYYZXH').disabled=document.all.item('SAYDLLY').disabled=false;
      }
      else
      {
        ydxx.style.display='none';
        document.all.item('SAYDDBH').style.backgroundColor=document.all.item('SAYDDH').style.backgroundColor=document.all.item('SAYDLDH').style.backgroundColor=document.all.item('SAYJKSL').style.backgroundColor=document.all.item('SAYJZXH').style.backgroundColor=document.all.item('SAYYZXH').style.backgroundColor=document.all.item('SAYDLLY').style.backgroundColor='#90E0FF';
        document.all.item('SAYDDBH').disabled=document.all.item('SAYDDH').disabled=document.all.item('SAYDLDH').disabled=document.all.item('SAYJKSL').disabled=document.all.item('SAYJZXH').disabled=document.all.item('SAYYZXH').disabled=document.all.item('SAYDLLY').disabled=true;
      }
    }
    function changeJS(sheng,fx)
    {
      var pos,sh,s,i,op;
      document.all.item('SAZ'+fx+'JI').options.length=0;
      document.all.item('SAZ'+fx+'JX').options.length=0;
      if(sheng!='')
      {
        sh=document.all.shi.value;
        pos=sh.indexOf('|'+sheng+'|');
        if(pos>=0)
        {
          pos=pos+('|'+sheng+'|').length;
          sh=sh.substring(pos,sh.indexOf('|',pos));
          //将数据导入下拉框中
          s=sh.split(' ');
          for(i=0;i<s.length;i++)
          {
            op=document.createElement('option');
            op.text=s[i];
            op.value=s[i];
            document.all.item('SAZ'+fx+'JI').add(op);
          }
        }
      }
    }
    function changeJI(sheng,shi,fx)
    {
      var pos,po,sh,s,i,op;
      document.all.item('SAZ'+fx+'JX').options.length=0;
      if(sheng!='')
      {
        sh=document.all.xian.value;
        pos=sh.indexOf("|"+sheng+"|");
        if(pos>=0)
        {
          pos=pos+("|"+sheng+"|").length;
          po=sh.indexOf("|"+shi+"!",pos);
          if(po>=pos)
          {
            po=po+("|"+shi+"!").length;
            sh=sh.substring(po,sh.indexOf("|",po))
            //将数据导入下拉框中
            s=sh.split(" ");
            for(i=0;i<s.length;i++)
            {
              op=document.createElement("option");
              op.text=s[i];
              op.value=s[i];
              document.all.item('SAZ'+fx+'JX').add(op);
            }
          }
        }
      }
    }
    //-->
    </SCRIPT>  </td>  
     </tr>
     <tr height=10><td></td></tr>
    </table>
    </form>
    </body>
      

  5.   

    <INPUT type="hidden" value="|北京| 北京|上海| 上海|湖北| 武汉 襄樊 宜昌 荆州 黄冈 孝感 咸宁 十堰 恩施 黄石 鄂州 荆门 随州 仙桃 潜江 天门|辽宁| 沈阳 大连 鞍山 本溪 朝阳 丹东 阜新 抚顺 葫芦岛 锦州 辽阳 盘锦 铁岭 营口|陕西| 西安 安康 宝鸡 汉中 铜川 渭南 咸阳 延安 榆林|四川| 成都 泸州 攀枝花 自贡 宜宾 德阳 内江 乐山 南充 绵阳 广元 遂宁 广安 达川 雅安 阿坝 甘孜 巴中 眉山 资阳|江苏| 南京 无锡 常州 淮阴 连云港 南通 宿迁 苏州 泰州 徐州 盐城 扬州 镇江|广东| 广州 深圳 惠州 江门 佛山 韶关 汕头 梅州 珠海 肇庆 茂名 湛江 中山 东莞 清远 河源 汕尾 阳江 潮州 揭阳 云浮 顺德 潮阳 南海|天津| 天津|甘肃| 兰州 临夏 定西 平凉 武威 张掖 酒泉 天水 金昌 白银 嘉峪关 庆阳|重庆| 重庆|河北| 石家庄 邯郸 秦皇岛 张家口 承德 唐山 廊坊 沧州 衡水 邢台 保定|山东| 济南 青岛 菏泽 淄博 德州 烟台 潍坊 济宁 泰安 临沂 枣庄 威海 东营 滨州 聊城 日照 莱芜|山西| 太原 大同 阳泉 长治 晋城 运城 忻州 临汾 朔州|河南| 郑州 商丘 安阳 鹤壁 新乡 焦作 开封 漯河 洛阳 南阳 平顶山 濮阳 三门峡 许昌 信阳 周口 驻马店|吉林| 长春 吉林 四平 通化 辽源 白山 松原 白城 延边|黑龙江| 哈尔滨 牡丹江 佳木斯 绥化 大庆 齐齐哈尔 鸡西 鹤岗 大兴安岭 黑河 七台河 伊春 双鸭山|安徽| 合肥 芜湖 蚌埠 马鞍山 铜陵 安庆 阜阳 淮南 淮北 黄山 滁州 宿州 六安 巢湖 宣城|浙江| 杭州 宁波 温州 舟山 台州 绍兴 衢州 丽水 嘉兴 金华 湖州|湖南| 长沙 岳阳 湘潭 株洲 衡阳 郴州 常德 益阳 娄底 邵阳 永州 怀化 张家界|江西| 南昌 九江 抚州 赣州 景德镇 吉安 萍乡 上饶 新余 宜春 鹰潭|福建| 福州 厦门 宁德 三明 南平 泉州 莆田 漳州|贵州| 贵阳 遵义 安顺 铜仁 毕节|广西| 南宁 桂林 柳州 北海 梧州 百色 防城港 钦州 贵港 玉林 河池|海南| 海口 三亚|云南| 昆明 玉溪 曲靖 昭通 楚雄 红河 文山 思茅 保山 大理 丽江 临沧|内蒙古| 呼和浩特 包头 乌海 赤峰|青海| 西宁 果洛 海北 海西 海东 黄南 海南 玉树|新疆| 乌鲁木齐 阿克苏 阿勒泰 昌吉 哈密 和田 克拉玛依 喀什 塔城 吐鲁番|宁夏| 银川 吴忠 固原|西藏| 拉萨 昌都 林芝 那曲 日喀则 山南|福建| 龙岗|" name=shi>
      

  6.   

    <HTML> 
    <HEAD> 
    <SCRIPT language=JavaScript> SubMenuinfo = new Array( 
        new Array( 
            new Array("产品1-1", 39482304), 
            new Array("产品1-2", 34802389), 
            new Array("产品1-3", 39823498), 
            new Array("产品1-4", 87587343), 
            new Array("产品1-5", 68798735), 
            new Array("产品1-6", 98098509), 
            new Array("产品1-7", 49490583), 
            new Array("产品1-8", 32898334), 
            new Array("产品1-9", 92340934), 
            new Array("产品1-10", 34923409), 
            new Array("产品1-11", 59384093) 
        ), 
        new Array( 
            new Array("产品2-1", 23840238), 
            new Array("产品2-2", 92390484), 
            new Array("产品2-3", 29048203), 
            new Array("产品2-4", 94098230), 
            new Array("产品2-5", 39234923), 
            new Array("产品2-6", 29345423), 
            new Array("产品2-7", 24890234), 
            new Array("产品2-8", 92349823) 
        ), 
        new Array( 
            new Array("产品3-1", 39482304), 
            new Array("产品3-2", 34802389), 
            new Array("产品3-3", 39823498), 
            new Array("产品3-4", 87587343), 
            new Array("产品3-5", 68798735), 
            new Array("产品3-6", 98098509), 
            new Array("产品3-7", 49490583), 
            new Array("产品3-8", 32898334), 
            new Array("产品3-9", 92340934), 
            new Array("产品3-10", 34923409), 
            new Array("产品3-11", 59384093) 
        ), 
        new Array( 
            new Array("产品4-1", 20394802), 
            new Array("产品4-2", 34982039), 
            new Array("产品4-3", 92348902), 
            new Array("产品4-4", 98203894), 
            new Array("产品4-5", 98234902), 
            new Array("产品4-6", 52938409) 
        ) 
    ); function fillSelectFromArray(selectCtrl, itemArray, goodPrompt, badPrompt, defaultItem) { 
        var i, j; 
        var prompt; 
        for (i = selectCtrl.options.length; i >= 0; i--) { 
            selectCtrl.options[i] = null; 
        } 
        prompt = (itemArray != null) ? goodPrompt : badPrompt; 
        if (prompt == null) { 
            j = 0; 
        } else { 
            selectCtrl.options[0] = new Option(prompt); 
            j = 1; 
        } 
        if (itemArray != null) {         for (i = 0; i < itemArray.length; i++) { 
                selectCtrl.options[j] = new Option(itemArray[i][0]); 
                if (itemArray[i][1] != null) { 
                    selectCtrl.options[j].value = itemArray[i][1]; 
                } 
                j++; 
            }         selectCtrl.options[0].selected = true; 
        } 

    </SCRIPT> 
    <title>下拉菜单</title> 
    <style type="text/css"> 
    <!-- 
    body { font-size: 9pt; margin-top: 0px} 
    td { font-size: 9pt} 
    .menu { font-family: "黑体"; font-size: 9pt; background-color: #CCCCFF} 
    --> 
    </style> <BODY bgcolor="#FFFFFF" text="#000000"> 
    <p align="center"> 
    </p> <table width="550" border="0" cellspacing="0" cellpadding="5" align="center" bgcolor="#F5F5F5"> 
     <tr> 
      <td> 
       <form name="main" method="post" action="collect.asp"" target="_blank"> 
        <div align="center"> 
         <select 
    onChange="fillSelectFromArray(this.form.SubMenu, ((this.selectedIndex == -1) ? null : SubMenuinfo[this.selectedIndex-1]));" name=MainMenu class="menu"> 
          <option value=-1 selected>选择产品分类 
          <option value="分类1">产品分类1 
          <option value="分类2">产品分类2 
          <option value="分类3">产品分类3 
          <option value="分类4">产品分类4 </option> 
         </select> 
         <select size=1 name=SubMenu class="menu"> 
          <option>---------------</option> 
          <option></option> 
          <option></option> 
          <option></option> 
          <option></option> 
         </select> 
         <input type="submit" value="查询" name="submit"> 
        </div> 
       </form> 
      </td> 
     </tr> 
    </table> </BODY> 
    </HTML> 自己手动添加一下拉,应该可以实现的!
      

  7.   

    随便到什么网站去找,有 城市下拉框的啊 , 去查看jsp/html源文件可以找到啊 。
      

  8.   

    <!--html 文件-->
    <html>
    <head>
    <title> 省市县关联菜单 </title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="Generator" content="EditPlus">
    <style>
    body,select
    {
    font-size:9pt;
    font-family:Verdana;
    }
    select {background-color:#F0F0F0;}
    </style>
    <script language="JavaScript" src="script/area.js"></script>
    <SCRIPT LANGUAGE = JavaScript>
    <!--
    var s=["s1","s2","s3"];
    var opt0 = ["省份","地级市","市、县级市、县"];
    function setup()
    {
    for(i=0;i<s.length-1;i++)
    document.getElementById(s[i]).onchange=new Function("change("+(i+1)+")");
    change(0);
    }
    //-->
    </SCRIPT>
    </head>
    <body bgcolor="#E0E0E0" onload="setup()">
    多级关联菜单:
    <form name="frm">
    <select id="s1"></select>
    <select id="s2"></select>
    <select id="s3"></select>
    </form></body>
    </html>
    --------------------------------------------------------------------------------
    回这个贴真是辛苦,说太长要分开回复,郁闷啊,先回复的是HTML。下面是JS的程序等候。。
      

  9.   

    <!--JS 文件-->
    function Dsy() { this.Items = {}; }
    Dsy.prototype.add = function(id,iArray) { this.Items[id] = iArray; } 
    Dsy.prototype.Exists = function(id) { if(typeof(this.Items[id]) == "undefined") return false; return true; };
    function change(v){
    var str="0";
    for(i=0;i<v;i++){ str+=("_"+(document.getElementById(s[i]).selectedIndex-1));};
    var ss=document.getElementById(s[v]);
    with(ss){
    length = 0;
    options[0]=new Option(opt0[v],opt0[v]);
    if(v && document.getElementById(s[v-1]).selectedIndex>0 || !v)
    {
    if(dsy.Exists(str)){
    ar = dsy.Items[str];
    for(i=0;i<ar.length;i++)options[length]=new Option(ar[i],ar[i]);
    if(v)options[1].selected = true;
    }
    }
    if(++v<s.length){change(v);}
    }
    }
    var dsy = new Dsy();<!-- 还有哈-->
      

  10.   

    dsy.add("0",["安徽省","北京市","福建省","甘肃省","广东省","广西壮族自治区","贵州省","海南省","河北省","河南省","黑龙江省","湖北省","湖南省","吉林省","江苏省","江西省","解放军","辽宁省","内蒙古自治区","宁夏回族自治区","青海省","山东省","山西省","陕西省","上海市","四川省","台湾省","天津市","西藏自治区","新疆维吾尔自治区","云南省","浙江省"]);  dsy.add("0_0_0",["枞阳县","大观区","怀宁县","郊区","潜山县","市辖区","宿松县","太湖县","桐城县","望江县","迎江区","岳西县"]); 
    dsy.add("0_0_1",["东市区","固镇县","怀远县","郊区","市辖区","五河县","西市区","中市区"]); 
    dsy.add("0_0_2",["巢湖市","含山县","和县","庐江县","无为县"]);
    dsy.add("0_0_3",["东至县","贵池市","青阳县","石台县"]); 
    下面的县市数组照这样定义就可以了,我一贴它说太长,如果你们谁想省事就给我发邮件:[email protected]或QQ:10386693
      

  11.   

    好啊
    谢谢
    [email protected]
      

  12.   

    我有sql的 要的话给我联系!
    msn : [email protected]
      

  13.   

    我也要!谢谢!
    [email protected]