字典表左右选择

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>管理中心 - 添加新配送点 </title>
<meta name="robots" content="noindex, nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="./app/view/back/styles/general.css" rel="stylesheet" type="text/css" />
<link href="./app/view/back/styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./app/view/back/js/shehe.js"></script>
<style type="text/css">
body{ background:#EEEEEE;margin:0; padding:0; font-family:"微软雅黑", Arial, Helvetica, sans-serif; }
a{ color:#006600; text-decoration:none;}
a:hover{color:#990000;}
.top{ margin:5px auto; color:#990000; text-align:center;}
.info select{ border:1px #993300 solid; background:#FFFFFF;}
.info{ margin:5px; text-align:center;}
.info #show{ color:#3399FF; }
.bottom{ text-align:right; font-size:12px; color:#CCCCCC; width:1000px;}
</style>
<style>
button{
border:1px solid #ccc;
cursor:pointer;
display:block;
margin:auto;
position:relative;
top:100px;
}</style>

<script language="javascript">
function fun_select_addany(theform){
var i;
for (i=0;i<theform.s_county.length;i++){
if (theform.s_county.options[i].selected == true){
if (theform.s_county.options[i].text !=""){
theform[‘right_select[]‘].options[theform[‘right_select[]‘].length]=new Option(theform.s_county.options[i].text);
theform.s_county.options[i] =new Option("");
}
}
}
for (i=0;i<theform.s_county.length;i++){
if (theform.s_county.options[i].text ==""){theform.s_county.options.remove(i); i--;}
}
}

function fun_select_addall(theform){
var i;
for (i=0;i<theform.s_county.length;i++){
if (theform.s_county.options[i].text !=""){
theform[‘right_select[]‘].options[theform[‘right_select[]‘].length]=new Option(theform.s_county.options[i].text);
}
}
theform.s_county.length=0;
}

function fun_select_dltany(theform){
var i;
for (i=0;i<theform[‘right_select[]‘].length;i++){
if (theform[‘right_select[]‘].options[i].selected == true){
if (theform[‘right_select[]‘].options[i].text !=""){
theform.s_county.options[theform.s_county.length]=new Option(theform[‘right_select[]‘].options[i].text);
theform[‘right_select[]‘].options[i] =new Option("");
}
}
}
for (i=0;i<theform[‘right_select[]‘].length;i++){
if (theform[‘right_select[]‘].options[i].text ==""){theform[‘right_select[]‘].options.remove(i);i--;}
}
}
function fun(){
var right_sel=document.getElementById("all_menu_list");
var ops = right_sel.getElementsByTagName(‘option‘) ;
console.log(ops);
console.log(ops.length);
for(var i=0; i<=ops.length; i++) {
ops[i].selected = true;
}
alert(right_sel);
}
function fun_select_dltall(theform){
var i;
for (i=0;i<theform[‘right_select[]‘].length;i++){
if (theform[‘right_select[]‘].options[i].text !=""){
theform.s_county.options[theform.s_county.length]=new Option(theform[‘right_select[]‘].options[i].text);
}
}
theform[‘right_select[]‘].length=0;
}
window.onload = function() {
_init_area();
}
</script>
</head>

<body>

<h1>
<span class="action-span"><a href="index.php?p=back&c=Peisongdian&a=listAll">查看全部配送点
</a></span>
<span class="action-span1"><a href="index.php?act=main">管理中心</a> </span><span id="search_id" class="action-span1"> - 添加新配送点</span>

</h1>
<!-- start goods form -->
<div class="tab-div">
<!-- tab bar -->
<div id="tabbar-div">
<p>
<span class="tab-front" id="general-tab">通用信息</span>
<span class="tab-back" id="detail-tab">详细描述</span>
<span class="tab-back" id="mix-tab">其他信息</span>
<span class="tab-back" id="gallery-tab">商品相册</span>
</p>
</div>

<!-- tab body -->
<form action="xx.php" method="post" name="myform" >
<!-- 第一个选的 -->
<table width="90%" id="general-table" align="center" border="0">

<!-- 这里开始 -->
<tr >
<td></td>
<td>
<select id="s_province" name="s_province"></select>&nbsp;&nbsp;
<select id="s_city" name="s_city" ></select>&nbsp;&nbsp;
</td>
</tr>
<tr>
<td></td>
<td align="center">

<div style="width: 150px; height: 190px ;float: left;">
<select multiple="true" ; style="width:150px; height: 180px;"id=‘s_county‘ name=‘s_county‘ >
</select>
</div>
<div style="width: 80px;float: left;">
<input language="javascript" name="btn_select_addany" onClick="fun_select_addany(document.myform)" type=button value="添加一个">
<input language="javascript" name="btn_select_addall" onClick="fun_select_addall(document.myform)" type=button value="添加全部">
<input language="javascript" name="btn_select_dltany" onClick="fun_select_dltany(document.myform)" type=button value="删除一个">
<input language="javascript" name="btn_select_dltall" onClick="fun_select_dltall(document.myform)" type=button value="删除全部">
</div>
<script src="http://sandbox.runjs.cn/uploads/rs/267/g3ugugjp/area.js" type="text/javascript"></script>
<div style="width:150px; height: 190px;float: left;" id="heh">
<select id="all_menu_list" name="right_select[]" size="15" multiple="true" style="width:150px; height: 180px" >
</select>
</div>

</td>

</table>
<div class="button-div">
<input type="submit" value=" 确定 " class="button" onclick="fun()" />
</div>
</form>
</div>

</body>
</html>

时间: 2024-08-08 09:41:47

字典表左右选择的相关文章

如何通过字典表来获取下拉数据的实现

①在web.xml中添加监听,启动的时候初始化. <!--Web ApplicationContext 载入,继承处Spring的ApplicationContextListener --> <listener> <listener-class>cn.sccl.common.web.StartupListener</listener-class> </listener> ②我们需要在启动Tomcat的时候,初始化bizCode数据 package

GreenPlum之生成月份字典表

--生成月份字典表 drop table if exists monthmapping; create table monthmapping as select cast(to_char(onday,'yyyymm') as integer) monthid,onday from ( select cast('2001-01-01 00:00:00' as timestamp) + (c ||' day')::interval as onday from generate_series(0,10

普通集合和泛型集合的区别,哈希表和字典表的区别,队列和堆栈的区别以及堆和栈的区别。

普通集合和泛型集合的区别: 泛型集合与传统集合相比 类型更安全. 泛型集合无需装箱拆箱操作. 泛型的重要性. 泛型是未来五年的主流技术 ... 通常情况下,建议您使用泛型集合,因为这样可以获得类型安全的直接优点而不需要从基集合类型派生并实现类型特定的成员.此外,如果集合元素为值类型,泛型集合类型的性能通常优于对应的非泛型集合类型(并优于从非泛型基集合类型派生的类型),因为使用泛型时不必对元素进行装箱. 下面的泛型类型对应于现有的集合类型: List 是对应于 ArrayList 的泛型类. Di

spring启动时加载字典表数据放入map

import java.util.HashMap; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import cn.zsmy.constant.Constant; import cn.zsmy.service.tmp.ExDictService; import cn.zsmy.

jQuery学习笔记(四)——表单选择

一.表单选择 1.$('input[type=password][name=user]').val() 2.$(':password[name=user]').val() 二.表单过滤 1.$(':enabled') 选择可使用的元素 2.$(':disabled') 选择不可使用的元素 3.$(':cheched') 选择选定的单选和复选元素 4.$(':selected') 选择选定的下拉菜单的元素

arraylist list 哈希表 字典表

//ArrayList //ArrayList alt = new ArrayList(); //alt.Add("123"); //alt.Add(123); //alt.Add(true); //bool iscontain = alt.Contains("1"); //alt.Clear(); /*alt.Insert(0, "abc")*/; //Console.WriteLine(iscontain); //for(int i = 0;

oracle 字典表查询

1.oracle 字典表查询 /*显示当前用户*/ show user 在sql plus中可用,在pl sql中不可用 /*查看所有用户名*/ select username,user_id,created from all_users; /*查看当前用户的用户详情*/ select username,user_id,account_status,lock_date,expiry_date,default_tablespace,temporary_tablespace,created,init

数据库字典表设计

在稍大一些的项目中,我们总是需要管理各种各样的类型类型数据(如商品类型.游戏类型...).对于这些类型的管理类似,如果为每 一种类型都建立一张表去维护(而在项目中,正常出现50种类型),那工作量是可想而之大,并且我们不得不去了解每一个类型表的名字, 以去关联它. 因此,我们需要一种数据模型以完成对多种多样类型管理的需求. 字典表dictionary 字段名           类型               是否可空    中文名         描述 dict_name    varchar

字典表设计

================================================================================================================================ 字典表设计及应用举例      为了响应志峰兄弟的需求,今天抽了点时间写点关于字典表设计的东西,顺便结合一个小的应用对设计做个用例体验.咱先来看看什么叫字典.     时间紧张,先略了,以后再谈呵呵字典存在的必要性及他的好处.     同上^