Multiple Checkbox Insert Handling
Every so often, I need to refresh my knowledge regarding how to handle multiple check box selections, and how they get handled on an action page to insert correctly in a DB.
In a helpdesk application, the admin assigns projects to technicians. He may assign one project to several technicians.
The first action page inserts the data from the form into the DB with time and date stamps, due dates, etc.
Here is where the selected checkboxes do not get passed.
The second action page depends on the fist, populating a junction table using:
<cfquery name="get_project_ID" datasource="#Request.BaseDSN#">
SELECT MAX (project_ID) as lastID
FROM main_projects
</cfquery>
<cfloop index="i" list="#tech_ID#">
<cfquery name="TheQuery" datasource="#Request.BaseDSN#">
INSERT
INTO junction_project_tech
(junc_tech_ID, junc_project_ID)
VALUES (
<cfqueryparam cfsqltype="cf_sql_integer" value="#i#">,
#get_project_ID.lastID#
)
</cfquery>
</cfloop>
Any help would be greatly appriciated-
newportweb
