onclick="javascript:selectAllCheckBox(this,document.thisJSP.chkUser);"
此处,最新版本的firefox和chrome显示以下错误消息: -
TypeError:document.thisJSP未定义
其中.thisJSP是我的表格名称......
Thnx提前。
这是我的表格
<form action="AjaxRightsMenu.jsp" name="thisJSP" method="POST">
<FieldSet>
<Legend vAlign="Top">
<Font color="green">User Details </Font>
</Legend>
<div vAlign="Top" style="overflow: scroll; height: 280px; max-height: 280px">
<input type="hidden" name="hdnScrollValue" value="<%=myController.scrollValue%>">
<Table Align="left" border="1" cellpadding="0" cellspacing="1" vAlign="Top" Width="100%">
<Thead>
<tr>
<th width="9%" class="unsortable">
<B><input type="button" name="chkSelectAll" value="Check All" onclick="javascript:selectAllCheckBox(this,document.thisJSP.chkUser);"></B>
</th>
<th align="left" Width="10%" colspan="1">Group Name</th>
<th align="left" Width="10%" colspan="1">Loc Name</th>
<th align="left" Width="10%" colspan="1">APP Name</th>
<th align="left" Width="10%" colspan="1">Menu Name</th>
<th align="left" Width="10%" colspan="1">View Rights</th>
<th align="left" Width="10%" colspan="1">Add Rights</th>
<th align="left" Width="10%" colspan="1">Edit Rights</th>
<th align="left" Width="10%" colspan="1">Del Rights</th>
<th align="left" Width="10%" colspan="1">Auth Rights</th>
</tr>
</Thead>
答案 0 :(得分:0)
AFAK,您的代码非常简洁!
以下是一些建议:
答案 1 :(得分:0)
document.forms['thisJSP'].elements['chkUser']
请参阅https://stackoverflow.com/a/16732108/2079345和https://developer.mozilla.org/en-US/docs/Web/API/Document/forms