<%@ page language="java" isELIgnored="false" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %> <%@ page import="com.wprss.util.*" %> <mce:style type="text/css"><!-- body { margin-left: 3px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } body,td,th { font-size: 13px; } --></mce:style><style type="text/css" mce_bogus="1">body { margin-left: 3px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } body,td,th { font-size: 13px; }</style> <mce:script type="text/javascript"><!-- function getValue() { var ChkboxValue = ""; var chks = document.getElementsByTagName("input"); for(var i=0; i<chks.length; i++) { if(chks[i].type=="checkbox" && chks[i].checked ) { if ( ChkboxValue == "" ) ChkboxValue = chks[i].value; else ChkboxValue += ","+chks[i].value; } } document.getElementById("hi").value=ChkboxValue; //alert(ChkboxValue); } // --></mce:script> <logic:present name="listFDC"> <logic:iterate id="it" name="listFDC" indexId="index"> <input type="checkbox" id="fdcdispaly" name="fdcdispaly" value="${it.wppid}" οnclick="getValue();"/>${it.wppname}<br> </logic:iterate> </logic:present> <mce:script type="text/javascript"><!-- var temp="${sessionScope.fdcdisplay}"; if(temp!="") { if(temp.indexOf(",")!=-1) { var strtext= new Array(); strtext=temp.split(","); //alert(document.all("fdcdispaly").length); for(var i=0;i<strtext.length;i++) { for(var j=0;j<document.all("fdcdispaly").length;j++) { if(document.all("fdcdispaly")[j].value==strtext[i]) { document.all("fdcdispaly")[j].checked=true; break; } } } } else { for(var j=0;j< document.all("fdcdispaly").length;j++) { if(document.all("fdcdispaly")[j].text==temp) { document.all("fdcdispaly")[j].checked=true; break; } } } //反选 for(var i=0;i<document.all("fdcdispaly").length;i++) { f =document.all("fdcdispaly")[i]; if(f.checked==false) { f.checked=true; } else { f.checked=false; } } } // --></mce:script> <input id="hi" name="hi" type="hidden" value="" />