隨筆-16  評(píng)論-8  文章-30  trackbacks-0

           

           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','請(qǐng)選擇' );
           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&nbsp;
          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>&nbsp;&nbsp;
          48<select name="catid">
          49    <option value="-1">請(qǐng)選擇</option>
          50    <option value="1" selected="selected">A1</option>
          51</select>
          52</form>
          53</body>
          54</html>
          posted on 2005-07-18 17:23 楚客 閱讀(283) 評(píng)論(0)  編輯  收藏 所屬分類: HTML
          主站蜘蛛池模板: 宁城县| 高青县| 炎陵县| 东城区| 镇远县| 武穴市| 平定县| 日照市| 凌云县| 普洱| 乳源| 北辰区| 晋州市| 图木舒克市| 衡山县| 扬中市| 汝州市| 青田县| 栖霞市| 房产| 金川县| 嘉黎县| 吉水县| 大城县| 青铜峡市| 新野县| 禄劝| 恩平市| 黄大仙区| 漳平市| 苍梧县| 杭锦旗| 湖南省| 申扎县| 和静县| 邯郸县| 龙江县| 进贤县| 桐乡市| 东乌珠穆沁旗| 怀柔区|