我记得好象是要index什么的,记不清楚拉,谁知道的,共享一下,谢谢!
<script language="javascript">
function openCardInfo(obj){
var id = document.all.id[obj].value;
var um_id = document.all.um_id[obj].value;
var name = document.all.name[obj].value;
var sex = document.all.sex[obj].value;
var version = document.all.version[obj].value;
document.all.deal1.src = "docc/deal1.jsp?userid="+id+"&name="+name+"&sex="+sex+"&um_id="+um_id+"&version="+version;
window.location.href = "/epasscms/initInfo.do";
}
</script>
<c:forEach var="card" items="${cardList}">
<input type="text" name="key" value="<c:out value="${index}"/>">
<input type="hidden" name="id" value="<c:out value="${card.id}"/>">
<input type="hidden" name="um_id" value="<c:out value="${card.um_id}"/>">
<input type="hidden" name="name" value="<c:out value="${card.name_cn}"/>">
<input type="hidden" name="sex" value="<c:out value="${card.sex}"/>">
<input type="hidden" name="version" value="<c:out value="${card.version}"/>">
<table border="0" cellpadding="0" cellspacing="1" bgcolor="#000000" id="tableRow" cellpadding="0" width="100%">
<tr height="24">
<td bgColor="#e7e7e7" width="85">用户所在机构</td>
<td bgColor="#ffffff"> <c:out value="${card.department}"/></td>
</tr>
<tr height="24">
<td bgColor="#e7e7e7" width="85">员工姓名</td>
<td bgColor="#ffffff"> <c:out value="${card.name_cn}"/></td>
</tr>
<tr height="24">
<td bgColor="#e7e7e7" width="85">用户编号</td>
<td bgColor="#ffffff" width="150"> <c:out value="${card.um_id}"/><a href="javascript:openCardInfo()">(点击对该员工进行发卡操作)</a></td>
</tr>
</table>
<br>
</c:forEach>
2 个解决方案
#1
<c:forEach ... varStatus="status">
${status.index}
</c:forEach>
${status.index}
</c:forEach>
#2
#1
<c:forEach ... varStatus="status">
${status.index}
</c:forEach>
${status.index}
</c:forEach>