I am working on a project where there is a list of items from the database and the screen is populated with the items, description, and a checkbox for the user to select. When the user processes the screen only those items are stored in the database. I have it all working but no real good idea on how to save the selected items to the database. Need some assistance on this one.
<!--- This sould be the MS SQL --->
<cfif isDefined('form.test')>
<cfoutput>This is a list of the items selected</cfoutput>
<cfloop list="#form.test#" index="i">
<cfparam name="form.#i#" default="">
#i#: #FORM[i]#
<br>
</cfloop>
</cfif>
<!--- Get the Data from the MS SQL Database --->
<cfquery name="getData">
Select
PositionID,
PositionLevelID,
Title,
ListSortOrder
From Position
Where PositionLevelID = 2
Order By ListSortOrder
</cfquery>
<!--- Start the screen --->
<!DOCTYPE html>
<html>
<head>
<title>
Equipment Listing
</title>
<link rel="stylesheet" type="text/css" href="../styles.css"/>
</head>
<body>
<cfform name="testing">
<cfloop query="GetData">
<input type="checkbox" name="#GetData.Title#" value="#GetData.PositionID#"/>
<cfoutput>
#title# #PositionID#
<br>
</cfoutput>
</cfloop>
<input name="test" type="Submit" value="testing">
</cfform>
</body>
</html>