`
___loveOfForever
  • 浏览: 78603 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

根据值选定多选框,选中多选框,根据存在的数据选中多选框

阅读更多
第一个list为所有的多选框的值,
第二个lists为默认选中的值。
<%
   for(int i = 0 ;i <list.size();i++){
      DeptnoForm df = (DeptnoForm)list.get(i);
    %>
      <input <%
      for(int j = 0 ;j <lists.size();j++){
      AreaForm a = new AreaForm();
      a=(AreaForm)lists.get(j);
      if(a.getDeptno().equals(df.getDeptno())){
      out.print("checked");
      }
      }
      %> type="checkbox" id="deptno" name="deptno" value="<%=df.getDeptno()%>">     <%=df.getName()%><br/>
    <%
  
    }
   %>
0
1
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics