Question : How can I check a dynamic row of checkboxes if value exists so I enter the row into a db?

I have a dynamic row of information and I'm only looking to input the rows where Form.seminars_beginner and Form.intermediates checkbox is checked. For now I just have the two checkboxes for my initial testing. I will have up to 10 checkboxes for each dynamic row. Everything works great except but I only want to INSERT data into the db where these checkboxes are actually checked. I have one other idea of how to do this but I thought I would check to see if there's a simpler solution.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
<cfloop from="1" to="#FORM.numberOfRecords#" index="Row">
		<cfparam name="FORM.sub_category_other_input#Row#" default="1">
		<cfparam name="FORM.seminars_beginner#Row#" default="0">
		<cfparam name="FORM.seminars_intermediate#Row#" default="0">
	
		<cfset sub_category_id = FORM["sub_category_id"& Row]>
		<cfset sub_category_other_input= FORM["sub_category_other_input"& Row]>
		<cfset seminars_beginner= FORM["seminars_beginner"& Row]>
		<cfset seminars_intermediate= FORM["seminars_intermediate"& Row]>
	
		<cfquery name="getMyData" datasource="#request.dsn#" username="#request.dsnusername#" password="#request.dsnpassword#">
			  INSERT INTO tg_2010_training_guide_topic_selections
				(advertiser_id,
				 sub_category_id,
				 sub_category_other_input,
				 seminars_beginner,
				 seminars_intermediate
				 )
			  VALUES 
				(
				  <cfqueryparam value="#advertiser_id#" cfsqltype="cf_sql_integer">,
				  <cfqueryparam value="#sub_category_id#" cfsqltype="cf_sql_integer">,
				  <cfqueryparam value="#sub_category_other_input#" cfsqltype="cf_sql_varchar">, 
				  <cfqueryparam value="#seminars_beginner#" cfsqltype="cf_sql_integer">,
				  <cfqueryparam value="#seminars_intermediate#" cfsqltype="cf_sql_integer">  
				)
		</cfquery>
	</cfloop>

Answer : How can I check a dynamic row of checkboxes if value exists so I enter the row into a db?

>> <cfif FORM["seminars_beginner"& Row] AND FORM["seminars_intermediate"& Row] >

.... This is a shorter way of saying:

   <cfif  FORM.TheFirstCheckboxValue NEQ  0 AND FORM.TheSecondCheckBoxValue NEQ 0>

It takes advantage of the fact that numbers can be evaluated as boolean. 0 evaluates to FALSE, and other numbers to TRUE.
Random Solutions  
 
programming4us programming4us