我的代码如下。当页面加载时,我需要默认选中这两个复选框。这显示查询的结果。现在,当其中一个复选框未选中时,需要提交表单并显示不同的查询结果。即使取消选中复选框,也会检查复选框。有人可以在这里指导我吗?ColdFusion表格中的复选框
<form action="abc.cfm?show=yes" method="post" name="myform">
<table align="center">
<tr>
<td>
<input type="checkbox" checked="checked" name="chkbox" id="chkbox1"> <strong> Agreement Only</strong>
<input type="hidden" name="chk" id="chk1">
<input type="checkbox" checked="checked" name="chkbox" id="chkbox2"> <strong>Active Employees</strong>
<input type="hidden" name="chk" id="chk2">
</td>
<td>
<input type="Submit" name="submitnow" value="View now">
</td>
</table>
</form>
<cfif isdefined("form.chk1")>
query 1
<cfelseif isdefined("form.chk2")>
query 2
</cfif>
对不起,这是一个类型的复选框chk1和chk2 – user747291
@ user747291:请在你的问题中解决这个问题。 – ale