Pattycake245
Programmer
I am trying to get java to see that a radio button is checked but it doesn't "see" it. It is a Cold Fusion app and there are a set of three buttons all with the same name but different values. When a radio button is selected and the form is submitted it is supposed to load the same page again, but with the radio button that was checked to still be checked and the other two buttons disabled. But what it is doing is disabling all of them because it is not recognizing that I have checked one of the buttons. Does this make any sense?
In it's simplest form, this is what my form looks like:
function doRadioCheck()
{
for(x=0;x<frm_monitor.elements.length;x++){
if(frm_monitor.elements[x].name.indexOf("rsch_sel") != -1){
if (frm_monitor.elements[x].value!="" && frm_monitor.elements[x].checked==true)
{
<cfset request.chk="CHECKED">
<cfset request.edit="">
}
else
{
<cfset request.chk="">
<cfset request.edit="DISABLED">
}}}
</cfif>
}
<form name="frm_monitor" action="mon_entry.cfm" method="post">
<table border align="center">
<tr>
<td Valign="left"><input type="radio" name="rsch_sel" value="VG" doRadioCheck() #request.chk# #request.edit#>#disp_vg#</td>
<td Valign="left"><input type="radio" name="rsch_sel" value="G" doRadioCheck() #request.chk# #request.edit#>#disp_g#</td>
<td Valign="left"><input type="radio" name="rsch_sel" value="NI" doRadioCheck() #request.chk# #request.edit#>#disp_ni#</td>
</tr>
</table>
<cfoutput><input type="submit" onClick="return doFormSubmit(this.form)">
<cfoutput>
</form>
Is this even possible or am I barking up the wrong tree here?
thanks, Tim
In it's simplest form, this is what my form looks like:
function doRadioCheck()
{
for(x=0;x<frm_monitor.elements.length;x++){
if(frm_monitor.elements[x].name.indexOf("rsch_sel") != -1){
if (frm_monitor.elements[x].value!="" && frm_monitor.elements[x].checked==true)
{
<cfset request.chk="CHECKED">
<cfset request.edit="">
}
else
{
<cfset request.chk="">
<cfset request.edit="DISABLED">
}}}
</cfif>
}
<form name="frm_monitor" action="mon_entry.cfm" method="post">
<table border align="center">
<tr>
<td Valign="left"><input type="radio" name="rsch_sel" value="VG" doRadioCheck() #request.chk# #request.edit#>#disp_vg#</td>
<td Valign="left"><input type="radio" name="rsch_sel" value="G" doRadioCheck() #request.chk# #request.edit#>#disp_g#</td>
<td Valign="left"><input type="radio" name="rsch_sel" value="NI" doRadioCheck() #request.chk# #request.edit#>#disp_ni#</td>
</tr>
</table>
<cfoutput><input type="submit" onClick="return doFormSubmit(this.form)">
<cfoutput>
</form>
Is this even possible or am I barking up the wrong tree here?
thanks, Tim