<tr>
<td><form:checkbox path="ftpScanEvents" id="chk" onclick="showMe('div1',this);"/>
<input type="hidden" value="1" name="_ftpScanEvents"/>
FTP Scan Events</td>
</tr>
<tr><td colspan="4">
<table id="div1" style="display:none">
<tr><td>Host Name</td><td>Directory</td><td>User Name</td><td>Password</td></tr>
<tr><td><form:input path="hostName" size="30" maxlength="200"/></td>
<td><form:input path="directory" size="30" maxlength="200"/></td>
<td><form:input path="userName" size="20" maxlength="20"/></td>
<td><form:input path="password" size="20" maxlength="20"/></td>
</tr>
</table>
</td></tr>
javascript:
function showMe (it, chkbox) {
var rr = (chkbox.checked) ? "block" : "none";
document.getElementById(it).style.display = rr;
}
我可以在复选框选择时隐藏/显示它。但是,我需要的是页面加载,如果选中复选框,则显示它,否则隐藏...