关联菜单.二级

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>关联菜单_二级</title>
<script language="javascript">
 
/*
使用说明:
1. 不要更改代码的位置,只须更改相应的数值值即可。
2.其他的网页设计内容,就添加到 <form><form/> 中。
3.具体使用时,去掉不必要的注释。
4.本例子来源于互联网

 2005.02.17

*/ 
 
function aClass(aData, aValue, aText) {
    if (aClass.arguments.length < 3)
      alert("传入的参数错误!")
    else {
      this.Data  = aData;
      this.Value = aValue;
      this.Text  = aText;
    }
  }

  function chgDnCombobox(aSrc, aDes, aClass, aRemain){
    if (chgDnCombobox.arguments.length < 3)
alert("传入的参数错误!")
    else if (aSrc.type != "select-one")
      alert("传入的参数错误!")
    else if (aClass == null)
      alert("aClass未定义错误!")
    else {
      if (aRemain==null)
        aRemain = 1;
      chgDnComboboxItem(aSrc.options[aSrc.selectedIndex].value, aDes, aClass, aRemain);
    }
  }

  function chgDnComboboxItem(aValue, aDes, aClass, aRemain){
    if (chgDnComboboxItem.arguments.length<3)
      alert("参数传入错误!")
    else if (aClass==null)
      alert("错误!aClass没有定义!")
    else{
      if (aRemain==null)
        aRemain = 1;
      deleteAllComboboxItem(aDes, aRemain);
      for (var i=0; i<aClass.length; i++)
        if (aClass[i].Data==aValue)  /* check aClass[i].Data */
          if (aClass[i].Data!="")
            addComboboxItem(aDes, aClass[i].Text, aClass[i].Value);
    }
  }

  function deleteAllComboboxItem(aList, aRemain) {
    for (var i=aList.options.length; i > aRemain-1; i--)
      aList.options[i] = null;
  }   

  function addComboboxItem(aList, aText, aValue) {
    var aOption = new Option(aText, aValue);
    eval("aList.options[aList.options.length]=aOption");
  }
</script>

<script language="javascript">

function onchg(aForm) {
onchg(document.myform);}
var f_Set0 = new Array(new aClass('国内', '北京', '北京'),
new aClass('国内', '广东', '广东'),
new aClass('国内', '广西', '广西'),
new aClass('国内', '上海', '上海'),
new aClass('国内', '福建', '福建'),
new aClass('国内', '天津', '天津'),
new aClass('国内', '湖南', '湖南'),
new aClass('国内', '湖北', '湖北'),
new aClass('国内', '浙江', '浙江'),
new aClass('国内', '河北', '河北'),
new aClass('国内', '山东', '山东'),
new aClass('国内', '四川', '四川'),
new aClass('国内', '安徽', '安徽'),
new aClass('国内', '辽宁', '辽宁'),
new aClass('国内', '江苏', '江苏'),
new aClass('国内', '甘肃', '河北'),
new aClass('国内', '青海', '山东'),
new aClass('国内', '江西', '江西'),
new aClass('国内', '宁夏', '宁夏'),
new aClass('国内', '山西', '山西'),
new aClass('国内', '江西', '江西'),
new aClass('国内', '云南', '云南'),
new aClass('国内', '吉林', '吉林'),
new aClass('国内', '河南', '河南'),
new aClass('国内', '陕西', '陕西'),
new aClass('国内', '黑龙江', '黑龙江'),
new aClass('国内', '贵州', '贵州'),
new aClass('国内', '海南', '海南'),
new aClass('国内', '新疆', '新疆'),
new aClass('国内', '内蒙古', '内蒙古'),
new aClass('国内', '西藏', '西藏'),
new aClass('国内', '香港', '香港'),
new aClass('国内', '台湾', '台湾'),
new aClass('国外', '美国', '美国'),
new aClass('国外', '日本', '日本'),
new aClass('国外', '英国', '英国'),
new aClass('国外', '法国', '法国'),
new aClass('国外', '意大利', '意大利'),
new aClass('国外', '德国', '德国'),
new aClass("End", "End", "End"));

function change_area(aForm) {
chgDnCombobox(aForm.CountryGroup, aForm.City, f_Set0 , 0)
}

</script>

</head>
<body>
<form name="myform" onSubmit="return noerror(myform)" method="post" action="youraction_script">
      <select name="CountryGroup" size=1 onChange='change_area(document.myform)'>
        <option value="国内">国内</option>
        <option value="国外">国外</option>
      </select>
      <select name="City" size=1>
        <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>
    </div></td>
</form>
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值