我使用复选框来检查我用Java开发的邮件系统中的邮件.
我想检查单击上方复选框上的所有复选框,但问题是根据检索到的邮件数量在循环中显示复选框.
请帮我,我应该把javascript代码放在哪里解决这个问题.
收件箱的循环代码如下:
<tr >
<% for(int i=0;i<messageList.size();i++) { message = (Message)messageList.get(i);%>
<td width="10%" height="33" align="left" valign="top" bgcolor="#EEE" >
<!--This link display the full message-->
<input name="Mark_Mail" id="mark_mail" onclick="myfunction(this);" type="checkbox" value="<%=message.getMailId()%>" width="50" height="30" align="top" >
<span id="space1" style="padding:2px"></span>
<!--Check all the Checkboxes-->
<script type="text/javascript">
function checkAll()
{
document.getElementById('mark_mail').checked = "true";
}
</script>
<img src="Images/UnStarred.jpg" height="15" border="0" id="image1" onclick="swapImage()" />
<span id="space1" style="padding:2px"></span>
</td>
<td width="90%" height="33" align="left" colspan="7" valign="bottom" bgcolor="#EEE" >
<!--This link display the full message-->
<a id="link" …Run Code Online (Sandbox Code Playgroud)