troubleshooting Question

check that a checkbox is checked on click of a button

Avatar of armanbena
armanbena asked on
HTMLColdFusion Language
7 Comments1 Solution483 ViewsLast Modified:
Hi,

I am working with a form, which contains a checkbox.  The user clicks a button.
I want to run a specific query, based on whether or not the checkbox has been checked.  So far I have been testing the value of the checkbox with no luck, and have a cfparam set to default ="" so that I don't get an error when loading to the page.
What am I doing wrong?
<form name="FrmOBI" method="post" action="save2.cfm"> 

      
          <table width="66%"  align="center" border="0" >
            <tr>  <td> <div align="center">Ready for review? <input name="ready" type="checkbox"  id="ready" value="1"/></div></td></tr>
          </table>
<script type="text/javascript">
function ChkData()
{

//if(document.FrmOBI.ready.checked == true)



//alert(document.FrmOBI.ready.Checked==true);
//
<cfif multipleList.RecordCount gt 0>
<cfloop query="multipleList">
		<cfif len(multipleList.NPSGroupNumber) gt 0>
			 <cffile action="write"  
		file="\\nwn401av317\y_b_g-dev\intranet\Agent_Editor\OBI\#multipleList.LOB#\#multipleList.NPSGroupNumber##multipleList.NPSGroupSection##multipleList.BPIDReg#bnftchart.obi" 
		output="#data1#" />
		<cfelse>
			 <cffile action="write"  
			file="\\nwn401av317\y_b_g-dev\intranet\Agent_Editor\OBI\#multipleList.LOB#\#multipleList.GroupNo#bnftchart.obi" 
			output="#data1#" />
		</cfif>
	<!---<cfif form.ready eq 1>--->
	<!---<cfif "FORM.ready.checked">--->
	<!---<cfif form.ready.checked>--->
	<cfif form.ready EQ "1">


			<CFQUERY DATASOURCE="Obi-default"  NAME="UpdateList" >
			  UPDATE OBI_Agent_Editor
			  SET Modified_By = #submittedByQry.employeeNumber#,
			  Modified_Date =  #Now()#,
			  Ready_Review = 1
			 WHERE TrackingNumber = #multipleList.TrackingNumber#
			</CFQUERY> 
	<cfelse>
			 <CFQUERY DATASOURCE="Obi-default"  NAME="UpdateList" >
			  UPDATE OBI_Agent_Editor
			  SET Modified_By = #submittedByQry.employeeNumber#,
			  Modified_Date =  #Now()#
			 WHERE TrackingNumber = #multipleList.TrackingNumber#
			</CFQUERY>
	</cfif>	
	</cfloop>  
	
<cfelse>
		<cfif form.ready EQ "1">
				<CFQUERY DATASOURCE="Obi-default"  NAME="Update" >
				  UPDATE OBI_Agent_Editor
				  SET Ready_Review = 1
				 WHERE TrackingNumber = #ListResult.TrackingNumber#
				</CFQUERY>  
	</cfif>

</cfif>	
	
	document.FrmOBI.submit();
}

</script>
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros