Hi,
I'm really struggling with this. I'm trying to populate the check boxes from the database, which I've managed. It then goes through to the landing page, but it takes the literal variable name with it instead of the value.
This is the code on first page:
<cfquery name="fromTools" datasource="cfook">
SELECT tools FROM toolsin WHERE custid = #custid#
</cfquery>
<cfform action="landing.cfml" method="post">
<!--- Check box. --->
<cfloop query="fromTools">
<input type="checkbox" name="myDataList" value="#fromTools.tools#" ><cfoutput>#fromTools.tools#</cfoutput> <br />
</cfloop>
<cfinput type="Submit" name="SubmitForm" value="Submit">
</cfform>
This names the checkboxes with the values from the tools column from the database. But then it goes to page 2:
<cfquery name="toolsin" datasource="cfook">
INSERT INTO toolsout VALUES("1234", <cfqueryparam value="#form.myDataList#">, CURRENT_TIMESTAMP)
</cfquery>
<cfdump var = #Form.myDataList#>
The problem is that #Form.myDataList# gives the value #fromTools.tools# instead of the value retrieved from the database. But the checkbox on page 1 does have the correct value printed next to it from the cfoutput #fromTools.tools# ... but it's taking that literal variable name instead of its value through to the next page. Any ideas?
Thanks in advance
I'm really new to coldfusion.