I used to use the following codes for the controlling 2 checkboxes.
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function checkBoxValidate(cb) {
for (j = 0; j < 2; j++) {
if (eval("document.myform.ckbox[" + j + "].checked") == true) {
document.myform.ckbox[j].checked = false;
if (j == cb) {
document.myform.ckbox[j].checked = true;
}
}
}
}
</script>
</HEAD>
</head>
<body>
<BODY>
<form name=myform action ="NextPage.asp">
Selection 1<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(0)"><br>
Selection 2<input type="checkbox" name="ckbox" onClick="javascript:checkBoxValidate(1)"><br>
---------------------------------------------------------------
Now I have been working with this code:
<form name="MyForm" METHOD="Post" ACTION="NextPage.asp
<table><tr>
<td>font size=3><b>Root Cause:</b>
<input TYPE="checkbox" NAME="RootCause"></td>
<td><b>Fin Approval:</b>
<input TYPE="checkbox" NAME="FinApproval"></td>
</tr></table>
In the NextPage.asp:
<%if Request.form("FinApproval") = "on" then%>
STATEMENT1.......
<%end if%>
<%if Request.form("RootCause") = "on" then%>
STATEMENT2.......
<%end if%>
Is there any way that I can control the checkbox( means check only one checkbox at a time like radio button)with different checkbox names or any suggestion is welcome,
Thanks...
|