drzeus
12-05-2003, 01:24 AM
Guys, if anybody can help me I would appreciate it very much. I have a coldfusion query, which displays information such as patient number, and also if a checkbox (crf) has been checked in the database for that visit. The user may then click or unclick this checkbox, I then need to pass the different values of this checkbox for each visit over to the next page to save it. Say there were four visits, then there would be four crf checkboxes, either checked or not. I want to write a script that can store the different crf checkbox values in an array to send to the next page through the url if need be. Can anybody shed some light on this predicament for me?
<cfloop index="i" list="#visits#"> (visits is 1,1,1,0,0,0,0 – one if that visit checkbox was ticked)
<cfif i is not 0>
<cfquery name="pget" datasource="Data">
select *
from gen
where patientnumber = '#patno#'
and visit in ('#i#');
</cfquery>
<cfif i is not 0>
<cfoutput>#pget.Patientnumber#</cfoutput>
<cfoutput>#pget.visit#</cfoutput>
<cfif pget.crf eq 1>
<cfset crfcheck = true>
<input name="crf" type="checkbox" checked>
<cfelse>
<cfset crfcheck = false>
<input name="crf" type="checkbox" value="0">
</cfif>
</cfif>
</cfif>
</cfloop>
<cfloop index="i" list="#visits#"> (visits is 1,1,1,0,0,0,0 – one if that visit checkbox was ticked)
<cfif i is not 0>
<cfquery name="pget" datasource="Data">
select *
from gen
where patientnumber = '#patno#'
and visit in ('#i#');
</cfquery>
<cfif i is not 0>
<cfoutput>#pget.Patientnumber#</cfoutput>
<cfoutput>#pget.visit#</cfoutput>
<cfif pget.crf eq 1>
<cfset crfcheck = true>
<input name="crf" type="checkbox" checked>
<cfelse>
<cfset crfcheck = false>
<input name="crf" type="checkbox" value="0">
</cfif>
</cfif>
</cfif>
</cfloop>