隨筆-16  評論-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','請選擇' );
           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">請選擇</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) 評論(0)  編輯  收藏 所屬分類: HTML
          主站蜘蛛池模板: 绥江县| 台安县| 昭平县| 金门县| 东台市| 新绛县| 伊川县| 连城县| 资中县| 防城港市| 临桂县| 罗定市| 永丰县| 凌海市| 镇坪县| 家居| 察雅县| 丽水市| 横山县| 盐津县| 嘉定区| 盐边县| 澜沧| 遂平县| 洛扎县| 丹阳市| 宜良县| 孝义市| 丽水市| 新郑市| 尉犁县| 延寿县| 沭阳县| 杨浦区| 茶陵县| 宁海县| 朔州市| 巨鹿县| 曲麻莱县| 隆林| 安宁市|