why not name the checkboxes the same, which will result in a comma-delimited
list. then you only have to check for one checkbox.
<cfoutput q
<cfif structKeyExists(form, 'shooter')>
<cfloop list="#form.shooter#" index="idx">
<cfquery name="register_shooters" datasource="#application.dsn#">
INSERT INTO Registrations (
shooter_id
, tournament_id
) VALUES (
<cfqueryparam value="#idx#" cfsqltype="cf_sql_integer"
/>
, <cfqueryparam value="#session.tournament_id#"
cfsqltype="cf_sql_integer" />
)
</cfquery>
</cfloop>
</cfif>
On Mon, Aug 25, 2008 at 6:37 PM, Rick Faircloth <[EMAIL PROTECTED]>wrote:
> I thought I had tried that, but I had tried it with
> value="<cfoutput>#shooter_id[currentRow]#</cfoutput>".
>
> The <cfoutput>'s around the value was causing the
> values to append because I was already using <cfoutput query = ...>
> Nested <cfoutput>'s... bad boy.
>
> But now I realize that I've got to figure out how to specify
> the names of the checkboxes which are checked for the insert query.
> The problem is with specifying which dynamic formfield has been checked.
> Perhaps I can run a cfloop on the "get_unregistered.recordcount" value
> and run a check to see if form.shooter_#index# is in the fieldnames...
>
> <cfloop from="1" to="#get_unregistered.recordcount#" index="i">
>
> <cfif isdefined("form.shooter_#i#")> (or something like that...)
>
> <cfquery name="register_shooters" datasource="#application.dsn#">
>
> insert into registrations
> ( shooter_id, tournament_id )
> values ( <cfqueryparam cfsqltype="cf_sql_integer"
> value="#form.shooter_#">,
> <cfqueryparam cfsqltype="cf_sql_integer"
> value="#session.tournament_id#"> )
>
> </cfquery>
>
> </cfif>
>
> </cfloop>
>
> Problems with that? Suggestions?
>
> Rick
>
>
>
>
>
> > -----Original Message-----
> > From: Matt Quackenbush [mailto:[EMAIL PROTECTED]
> > Sent: Monday, August 25, 2008 8:57 PM
> > To: CF-Talk
> > Subject: Re: What am I missing???
> >
> > <input name="shooter_#currentrow#" type="checkbox"
> > value="#shooter_id[currentRow]#">
> >
> >
> >
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:311543
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4