js中的listbox

来源:互联网 发布:zdm软件下载 编辑:程序博客网 时间:2024/05/03 07:06

js中的listbox

<script language=javascript>
<!--
    function dosall()
    {
        var i = 0;
        var len = document.frmxx.dxry.options.length;
   
        for(i=0;i<len;i++){
            var e = document.createElement("option");
            e.value = document.frmxx.dxry.options[i].value;
            e.text = document.frmxx.dxry.options[i].text;
            document.frmxx.yxry.add(e);
        }
       
        for(i=0;i<len;i++){
            document.frmxx.dxry.remove(0);
        }
    }
   
    function dosone()
    {
        var e = document.createElement("option");
        e.value = document.frmxx.dxry.options[document.frmxx.dxry.selectedIndex].value;
        e.text = document.frmxx.dxry.options[document.frmxx.dxry.selectedIndex].text;
        document.frmxx.yxry.add(e);
        document.frmxx.dxry.remove(document.frmxx.dxry.selectedIndex);
    }
   
    function dodsone()
    {
        var e = document.createElement("option");
        e.value = document.frmxx.yxry.options[document.frmxx.yxry.selectedIndex].value;
        e.text = document.frmxx.yxry.options[document.frmxx.yxry.selectedIndex].text;
        document.frmxx.dxry.add(e);
        document.frmxx.yxry.remove(document.frmxx.yxry.selectedIndex);
    }
   
    function dosnone()
    {
        var i = 0;
        var len = document.frmxx.yxry.options.length;
       
        for(i=0;i<len;i++){
            var e = document.createElement("option");
            e.value = document.frmxx.yxry.options[i].value;
            e.text = document.frmxx.yxry.options[i].text;
            document.frmxx.dxry.add(e);
        }
        for(i=0;i<len;i++){
            document.frmxx.yxry.remove(0);
        }
    }
   
   
   
   
-->
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" href="css/main.css">
<title>选择轮阅部门</title>
</head>

<body topmargin="0" leftmargin="0" oncontextmenu="return false" onselectstart="return false" ondragstart="return false" >

<table width=470 border=0 align=center cellpadding=0 cellspacing=0 style="margin-left:7px">
    <tr>
        <td>
        <form method=post name=frmxx id=frmxx>
        <table width="100%" align=center>
            <tr align=center style="font-size:12px">
                <td>可选部门</td>
                <td> </td>
                <td>已选部门</td>
            </tr>
            <tr align=center>
                <td>
                    <select id=dxry name=dxry style="display:inline;width: 100%" size=9 rows=9 ondblclick="dosone()">
                   
                        <option value="3002">办公室</option>
                   
                        <option value="3003">政策法规处</option>
                   
                        <option value="3004">组织宣传处</option>
                   
                        <option value="3005">人事处</option>
                   
                        <option value="3006">计划财务处</option>
                   
                        <option value="3008">高教师训处</option>
                   
                        <option value="3009">高校办</option>
                   
                        <option value="3010">基教处</option>
                   
                        <option value="3011">团工委</option>
                   
                        <option value="3012">语委办</option>
                   
                        <option value="3013">职成教处</option>
                   
                        <option value="3014">体艺卫处</option>
                   
                        <option value="3015">督导处</option>
                   
                        <option value="3016">高招办</option>
                   
                        <option value="3017">监察审计室</option>
                   
                        <option value="3018">教育工会</option>
                   
                        <option value="3020">机关党委</option>
                   
                        <option value="3035">国际交流处</option>
                   
                        <option value="3036">妇委会</option>
                   
                    </select>
                </td>
                <td valign=center width=40>
                        <span valign=center>
                       
                    <input type=button class=button value="全选&gt;&gt;" id=bsall name=bsall onClick="dosall()">
                    <input type=button class=button value="选中 &gt;" id=AA name=AA onClick="dosone()">
                    <input type=button class=button value="&lt; 清除" id=BB name=BB onClick="dodsone()">
                    <input type=button class=button value="&lt;&lt;全清" id=bsnone name=bsnone onClick="dosnone()">
                </td>
                <td>
                    <select id=yxry name=yxry style="display:inline;width: 100%" size=9 rows=9 ondblclick="dodsone()">
                       
                    </select>
                </td>
            </tr>
            <tr>
                <td align=center valign="bottom" height="30" colspan=3>
                    <input type=button value=确定 name="bQD" id="bQD" onClick="vbscript:doSave">  
                    <input type=button value=取消 name="bFQ" id="bFQ" onclick='vbscript:window.close'>
                </td>
            </tr>
        </table>
        </form>
       
       
        </td>
    </tr>
   
</table>

</body>
</html>

原创粉丝点击