`
canofy
  • 浏览: 821177 次
  • 性别: Icon_minigender_1
  • 来自: 北京、四川
社区版块
存档分类
最新评论

select的multiple属性的应用

    博客分类:
  • j2EE
阅读更多
function srcToDest(srcid,destid){ 
	     var optionsObjects=document.getElementById(srcid);  
	     var optionsSubObjects=document.getElementById(destid);
	      
	     for(var o=0;o<optionsObjects.length;o++) { 	     	  
		 	if(optionsObjects.options[o].selected==true)  { 
		 	//获取源的value值和text值
			     var optionsvalue=optionsObjects.options[o].value;  
			     var optionstext=optionsObjects.options[o].text; 			     
			     addoptions(destid,optionstext,optionsvalue)  
		      }  
	     }  
       }         
         
       //向目标  
	 function addoptions(objectid,textvalue,optionsvalue){  
		 var optionsSubObjects=document.getElementById(objectid);  
		 var hasexist=0;  
		 for(var o=0;o<optionsSubObjects.length;o++){		 	  
			  var optionsvalue_sub=optionsSubObjects.options[o].text;  
			  if(optionsvalue_sub==textvalue)  hasexist+=1;  
		 } 
		 var  Browser_Name=navigator.appName;
		 
		 
		 if(hasexist==0) {  
		 	//optionsSubObjects.add(new Option(textvalue, optionsvalue)); 
		 	if(Browser_Name=='Netscape'){
		 		optionsSubObjects.add(new Option(textvalue, optionsvalue),null); 
			 }else{
			 	optionsSubObjects.add(new Option(textvalue, optionsvalue));
			 }	 		
		  	
		 } 
		 for(i=0;i<optionsSubObjects.length;i++){  
             optionsSubObjects.options[i].selected=true;  
  		 }
		     
	 } 
   
	 //将对象中所选的项删除 
	 function destToSrc(objectid)  {  
	 	var optionsObjects=document.getElementById(objectid);
		 for(var o=0;o<optionsObjects.length;o++)  {  
				 if(optionsObjects.options[o].selected==true)  {  
				    var optionsvalue=optionsObjects.options[o].value;  
				    var optionstext=optionsObjects.options[o].text;  
		       			removeoption(objectid,optionstext,optionsvalue)  
		  		}  
	 	}  
	 }  
   
	 //删除单个选项  
	 function removeoption(objectid,textvalue,optionsvalue)  {  
	 	var optionsSubObjects=document.getElementById(objectid);  
		 for(var o=0;o<optionsSubObjects.length;o++) {  
			  var optionsvalue_sub=optionsSubObjects.options[o].text;  
			  if(optionsvalue_sub==textvalue)  
			        optionsSubObjects.removeChild(optionsSubObjects.options[o]);
		 	}  
	 }  
	 
	 
	 
	 
	      
	     // 全选的js
	      
	      var allcheck=false;
			 function checkall(){   //批量操作(选取) 
			  	var all=document.getElementsByTagName("input");
			  	 for(var i=0;i<all.length;i++){
			  			if(all[i].type=="checkbox")	all[i].checked=!allcheck;
			  	 }
			  	allcheck=!allcheck;
			  }

HashMap在页面中的判断
  <td>	
   <select multiple="multiple" size="15" style="width=200px" id="source"> 
		         <option value="1">aaaa</option>  	         
	         	<option value="2">bbbb</option>  	 
	         	<option value="3">cccc</option>  	 
	         	<option value="4">dddd</option>  	 
	        </select>
    	
    	<input type="button" value=" &gt;&gt; "  onclick="javascript:srcToDest('source','target')">     
        <input type="button"  value=" &lt;&lt; " onclick="javascript:destToSrc('target')">  
   		<select multiple="multiple" size="15" style="width=200px" id="target" name="target"></td>


   		<td>操作系统</td>
	      <td><input type="checkbox" value="全部" onclick="checkall1('os');"/>全部<br/>
	      	  <c:forEach items="${osList}" var="result" varStatus="recordCount">
	      	  	<input type="checkbox" name="os" value="${result.id}" 	<c:if test="${osMap[result.id]!=null }">checked</c:if> />${result.operationId}
	      	  	<c:if test="${recordCount.count==5}"><br /></c:if>	      	  
	      	  </c:forEach>
	      </td>
分享到:
评论

相关推荐

    html入门到放弃笔记

    WEB,是基于Internet上的一种应用程序(网页应用程序) WEB页面,简称WEB页(网页),就是保存在服务器端上的一个具体的页面( **.html / **.htm 作为结尾的文件) 2、WEB浏览器 1、功能 1、提交用户请求 (UA : User ...

    Sublime Text3_64.rar

    Sublime Text还支持一次选中多行的操作:Furthermore, Sublime Text brings lets us select multiple lines at once, which can significantly boost your productivity. There are several ways to perform this ...

    SQL21日自学通

    The Use of DISTINCT When Selecting Multiple Columns487 Dropping an Unqualified Table 487 The Use of Public Synonyms in a Multischema Database488 The Dreaded Cartesian Product 488 Failure to Enforce ...

    Development.apk(Android Dev Tools)

    例如:LatinIMESettings“android键盘设置” Multiple(normal):倍数(正常的) Process(程序) com.android.inputmethod.latin Task Affinity(任务类同) com.android.inputmethod.latin Required Permission(许可要求...

    Hibernate+中文文档

    16.1.4. 返回多个实体(Returning multiple entities) 16.1.5. 返回非受管实体(Returning non-managed entities) 16.1.6. 处理继承(Handling inheritance) 16.1.7. 参数(Parameters) 16.2. 命名SQL查询 ...

    Hibernate_3.2.0_符合Java习惯的关系数据库持久化

    16.1.4. 返回多个实体(Returning multiple entities) 16.1.5. 返回非受管实体(Returning non-managed entities) 16.1.6. 处理继承(Handling inheritance) 16.1.7. 参数(Parameters) 16.2. 命名SQL查询 ...

    HibernateAPI中文版.chm

    16.1.4. 返回多个实体(Returning multiple entities) 16.1.5. 返回非受管实体(Returning non-managed entities) 16.1.6. 处理继承(Handling inheritance) 16.1.7. 参数(Parameters) 16.2. 命名SQL查询 ...

    hibernate3.2中文文档(chm格式)

    16.1.4. 返回多个实体(Returning multiple entities) 16.1.5. 返回非受管实体(Returning non-managed entities) 16.1.6. 处理继承(Handling inheritance) 16.1.7. 参数(Parameters) 16.2. 命名SQL查询 ...

    flash shiti

    15. 下列那几个属性是flash mx 不建议使用的属性 □ A. scroll □ B. maxscroll □ C. _droptarget □ D. _highquality 16. 下面的语句说法正确的是: □ A. 目前Flash 最新的创作平台是Flash MX,播放插件是Flash ...

    NHibernate参考文档 2.0.0 chm

    14.1.4. 返回多个实体(Returning multiple entities) 14.1.4.1. 别名和属性引用(Alias and property references) 14.1.5. 返回非受管实体(Returning non-managed entities) 14.1.6. 处理继承(Handling inheritance...

    NHibernate中文帮组文档(2008.11月更新)

    14.1.4. 返回多个实体(Returning multiple entities) 14.1.4.1. 别名和属性引用(Alias and property references) 14.1.5. 返回非受管实体(Returning non-managed entities) 14.1.6. 处理继承(Handling inheritance...

    Hibernate中文详细学习文档

    16.1.4. 返回多个实体(Returning multiple entities) 16.1.5. 返回非受管实体(Returning non-managed entities) 16.1.6. 处理继承(Handling inheritance) 16.1.7. 参数(Parameters) 16.2. 命名SQL查询 ...

    Hibernate 中文 html 帮助文档

    16.1.4. 返回多个实体(Returning multiple entities) 16.1.4.1. 别名和属性引用(Alias and property references) 16.1.5. 返回非受管实体(Returning non-managed entities) 16.1.6. 处理继承(Handling inheritance...

    Hibernate参考文档

    16.1.4. 返回多个实体(Returning multiple entities) 16.1.4.1. 别名和属性引用(Alias and property references) 16.1.5. 返回非受管实体(Returning non-managed entities) 16.1.6. 处理继承(Handling inheritance...

    autocad命令全集

    168 MULTIPLE   反复多次执行上一次命令直到 执行别的命令或按Esc键 169 MVIEW MV 创建多视窗 170 MVSETUP   控制视口 171 NEW   新建图形文件 172 OFFSET O 偏移复制实体 173 OLELINKS   更新、编辑或取消已...

    Spring-Reference_zh_CN(Spring中文参考手册)

    select标签 13.9.8. option标签 13.9.9. options标签 13.9.10. textarea标签 13.9.11. hidden标签 13.9.12. errors标签 13.10. 处理异常 13.11. 惯例优先原则(convention over configuration) 13.11.1. 对控制器的...

    xheditor-1.1.14

    upMultiple:允许一次上传多少个文件 参数值:大于0的数值,默认:99,设置为1关闭多文件上传 说明:本功能需要浏览器支持HTML5上传 备注:1.0.0 RC3新添加 upLinkUrl:超链接文件上传接收URL 参数值:接收用户上传的...

    protel2004封装

    alt+tab——在打开的各个应用程序之间切换 a——弹出edit\align子菜单 b——弹出view\toolbars子菜单 e——弹出edit菜单 f——弹出file菜单 h——弹出help菜单 j——弹出edit\jump菜单 l——弹出edit\set location ...

    Oracle9i的init.ora参数中文说明

    只有行锁将用于SELECT FOR UPDATE, 但在更新时将获取表锁。 值范围: ALWAYS | DEFAULT | INTENT 默认值: ALWAYS shared_servers 说明 : 指定在启动例程后, 要为共享服务器环境创建的服务器进程的数量。 值范围: ...

    C++MFC教程

    而各种对象都拥有各种属性,下面分别讲述各种GUI对象和拥有的属性。 字体对象CFont用于输出文字时选用不同风格和大小的字体。可选择的风格包括:是否为斜体,是否为粗体,字体名称,是否有下划线等。颜色和背景色不...

Global site tag (gtag.js) - Google Analytics