1<html>
2<head>
3<title>杰易CMS</title>
4<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
5<script language="JavaScript">
6<!--
7var sectioncategories = new Array;
8sectioncategories[0] = new Array( '-1','-1','请选择' );
9sectioncategories[1] = new Array( '1','1','A1' );
10sectioncategories[2] = new Array( '2','2','B2' );
11sectioncategories[3] = new Array( '3','3','C3' );
12sectioncategories[4] = new Array( '3','4','C4' );
13
14function changeDynaList( listname, source, key, orig_key, orig_val ) {
15 var list = eval( 'document.adminForm.' + listname );
16 // empty the list
17 for (i in list.options.length) {
18 list.options[i] = null;
19 }
20 i = 0;
21 for (x in source) {
22 if (source[x][0] == key) {
23 opt = new Option();
24 opt.value = source[x][1];
25 opt.text = source[x][2];
26
27 if ((orig_key == key && orig_val == opt.value) || i == 0) {
28 opt.selected = true;
29 }
30 list.options[i++] = opt;
31 }
32 }
33 list.length = i;
34}
35//-->
36</script>
37</head>
38
39<body>
40<br />
41<form name="adminForm" action="index2.php" method="post">
42
43<select name="sectionid" onchange="changeDynaList( 'catid', sectioncategories, document.adminForm.sectionid.options[document.adminForm.sectionid.selectedIndex].value, 0, 0);">
44 <option value="1" selected="selected">A</option>
45 <option value="2">B</option>
46 <option value="3">C</option>
47</select>
48<select name="catid">
49 <option value="-1">请选择</option>
50 <option value="1" selected="selected">A1</option>
51</select>
52</form>
53</body>
54</html>
posted on 2005-07-18 17:23
楚客 阅读(273)
评论(0) 编辑 收藏 所属分类:
HTML