I have a form in Cold Fusion that contains a set of checkboxes. I submit this form to frag5.cfm. There is only one line of code in frag5.cfm.
<cfoutput>values are #form.f1# </cfoutput>
This line displays "values" - that is, the form values for the flags, all with the name f1 are not selected.
Is it wrong to get these values? Can someone tell me what to do? The original form is below:
<form name = "fields"
action = "frag5.cfm"
method = "post"
onkeypress = "return event.keyCode != 13;">
<table style = "margin-left:165px" >
<caption style = "padding-top: 20px" >Restrict Report To: </caption>
<tr>
<td>Master Event:</td>
<td><input type = "checkbox"
id = "cb_e"
name = "f1"
value = ""
onclick = ischecked("cb_e","hid_e")
class = "check1">
<label for = "cb_e"> </label>
<input type = "hidden" name = "finsel" id = "hid_e" value = "unchecked">
</td>
<td style = "width: 25px"> </td>
<td>SubEvent:</td>
<td><input type = "checkbox"
id = "cb_s"
value = ""
name = "f1"
onclick = ischecked("cb_s","hid_s")
class = "check1" >
<label for = "cb_s"> </label></td>
<input type = "hidden" name = "finsel" id = "hid_s" value = "unchecked">
</td>
</tr>
</table>
<table style ="margin-left: 175px; margin-top: 20px;" >
<td style = "width: 150px;" id = "chuprep" class = ixes2">
</td>
<td style = "width: 150px;">
<input type = "Submit"
name ="Submitfin1"
class = "submitbut"
value = "Submit" >
</td>
</tr>
</table>
</form>
Code for ischecked:
function ischecked(id, passid) {
var ischeck = document.getElementById(id).checked;
if(ischeck){
document.getElementById(passid).value = "checked";}
else {
document.getElementById(passid).value = "unchecked";}
}
source
share