gweber

每一缕清新的阳光都值得珍惜,每一首歌都有最美丽的旋律,每一个生命都应该受到尊重。

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

 

 1<html>
 2<head>
 3<title>List</title>
 4<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
 5<script LANGUAGE="javascript">
 6var onecount;
 7onecount=0;
 8    
 9subcat = new Array();
10subcat[0= new Array("徐汇区","01","001");
11subcat[1= new Array("嘉定区","01","002");
12subcat[2= new Array("黄浦区","01","003");
13subcat[3= new Array("南昌市","02","004");
14subcat[4= new Array("九江市","02","005");
15subcat[5= new Array("上饶市","02","006");
16
17onecount=6;
18
19function changelocation(locationid)
20    {
21    document.myform.smalllocation.length = 0
22
23    var locationid=locationid;
24    var i;
25    document.myform.smalllocation.options[0= new Option('====所有地区====','');
26    for (i=0;i < onecount; i++)
27        {
28            if (subcat[i][1== locationid)
29            { 
30            document.myform.smalllocation.options[document.myform.smalllocation.length] = new Option(subcat[i][0], subcat[i][2]);
31            }        
32        }
33        
34    }    
35</script>
36</head>
37<body>
38<form name="myform" method="post">
39    <select name="biglocation" onChange="changelocation(document.myform.biglocation.options[document.myform.biglocation.selectedIndex].value)">
40        <option value="01" selected>上海</option>
41        <option value="02">江西</option>
42    </select>
43    <select name="smalllocation"> 
44        <option selected value="">==所有地区==</option>
45    </select>
46</form>
47<script LANGUAGE="javascript"> 
48<!-- 
49    changelocation(document.myform.biglocation.options[document.myform.biglocation.selectedIndex].value); 
50//--> 
51</script>
52</body>
53</html>
54
posted on 2005-07-12 08:11  Gweber.NET  阅读(2011)  评论(2编辑  收藏  举报