这是我第一次在 Stackoverflow 中提问
我在 asp 中选择特定框时遇到同样的问题
我将较旧的帖子称为
function toggleCheckBoxes(elem) {
var div = document.getElementById('<% = divid.ClientID %>');
var chk = div.getElementsByTagName('input');
var len = chk.length;
for (var i = 0; i < len; i++) {
if (chk[i].type === 'checkbox') {
chk[i].checked = elem.checked;
}
}
}
接着
'CheckAll
<input type="checkbox" id="chkAll" runat="server" onclick="toggleCheckBoxes(this)" />
但我的盒子是:
response.Write "</td>"
response.Write "<td nowrap><input type=checkbox name=process_1 "
if mEditRecMode and ConvertNullToString(mConsigneeArray(9))="1" then
response.Write " checked"
response.Write "/>1</td>"
response.Write "<td nowrap><input type=checkbox name=process_2 "
if mEditRecMode and ConvertNullToString(mConsigneeArray(10))="1" then
response.Write " checked"
response.Write "/>2</td>"
response.Write "<td nowrap><input type=checkbox name=process_3 "
if mEditRecMode and ConvertNullToString(mConsigneeArray(11))="1" then
response.Write " checked"
response.Write "/>3</td>"
response.Write "<td nowrap><input type=checkbox name=process_4 "
if mEditRecMode and ConvertNullToString(mConsigneeArray(12))="1" then
response.Write " checked"
response.Write "/>4</td>"
response.Write "<td nowrap><input type=checkbox name=process_5 "
if mEditRecMode and ConvertNullToString(mConsigneeArray(13))="1" then
response.Write " checked"
response.Write "/>5</td>"
response.Write "<td nowrap><input type=checkbox name=process_6 "
if mEditRecMode and ConvertNullToString(mConsigneeArray(14))="1" then
response.Write " checked"
response.Write "/>6</td>"
response.Write "<td nowrap><input type=checkbox name=process_7 "
if mEditRecMode and ConvertNullToString(mConsigneeArray(15))="1" then
response.Write " checked"
response.Write "/>7</td>"
response.Write "<td nowrap><input type=checkbox name=process_8 "
if mEditRecMode and ConvertNullToString(mConsigneeArray(16))="1" then
response.Write " checked"
response.Write "/>8</td>"
response.Write "<td nowrap><input type=checkbox name=process_9 "
if mEditRecMode and ConvertNullToString(mConsigneeArray(17))="1" then
response.Write " checked"
response.Write "/>9</td>"
response.Write "</tr>"
response.Write "</table>"
我如何全选/取消选择
请帮忙。