---
title: "修改时多checkbox的选中"
author: "ware"
date: "2010-12-09T10:19:53Z"
tags: []
categories: ["Web前端"]
slug: "checkbox"
draft: false
lastmod: "2010-12-09T10:19:53Z"
id: 837299
url: "https://ware.iteye.com/blog/837299"
---

<tr>
							<td width="10%" class="odd">
								技师：
							</td>
							<td colspan="3">
								<logic:notEmpty name="empList">
									<logic:iterate id="emp" name="empList" indexId="index">
										<input type="checkbox" name="CEmpId" id="emp${emp.CEmpId }"
											value="${emp.CEmpId }" />
										${emp.CEmpName }
								</logic:iterate>
								</logic:notEmpty>
					<script>
						var b="${objection.CEmpId}";
						var a=b.split(",");
						var empId=document.getElementsByName("CEmpId");
						for(var i=0;i<a.length;i++)
						{	
							for(var j = 0;j<empId.length;j++){
								if(a*==empId.value){
									document.getElementById("emp"+a*).checked=true;
								}
							}
						}
					</script>
							</td>
						</tr>