1
<html>
2
<head>
3
<title>List</title>
4
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
5
<script LANGUAGE="javascript">
6
var onecount;
7
onecount=0;
8
9
subcat = new Array();
10
subcat[0] = new Array("徐汇区","01","001");
11
subcat[1] = new Array("嘉定区","01","002");
12
subcat[2] = new Array("黄浦区","01","003");
13
subcat[3] = new Array("南昌市","02","004");
14
subcat[4] = new Array("九江市","02","005");
15
subcat[5] = new Array("上饶市","02","006");
16
17
onecount=6;
18
19
function 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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54