Thank you Josh, that was it.

Bruce

On 12/19/06, Josh Nathanson <[EMAIL PROTECTED]> wrote:
>
> Hi Bruce,
>
> I think you might want to reconsider looping over the field names.  You
> are
> trying to insert multiple fields while looping over fields one at a time
> --
> I don't think that will work.
>
> If you know how many groups of fields are coming from the form (the last
> number on the end of _ on your fields), you could do something like below.
> For example you have 4 groups of NAME, PHONE and EMAIL fields,
> form.numgroups would be 4.  There is probably a loop in your form that is
> generating the dynamic fields so you would pass that value as a hidden
> form
> variable.  Below is not tested but I think you'll have more luck if you go
> down that road.
>
> <cfloop from="1" to="#form.numgroups#" index="i">
>     <cfset namefield = "NAME_" & i>
>     <cfset phonefield = "PHONE_" & i>
>     <cfset emailfield = "EMAIL_" & i>
>
>     <cfquery datasource="#Application.dsource#">
>      INSERT INTO tblElection_Committee
>     (Proc_ID, Name, Phone, Email)
>     VALUES (#Session.Procedure_ID#
>         <cfif len(StructFind(form, namefield))>
>         ,#StructFind(form, namefield)#
>         <cfelse>
>        , ''
>         <cfif>
>
>         <cfif len(StructFind(form, phonefield))>
>         ,#StructFind(form, phonefield)#
>          <cfelse>
>            , ''
>         </cfif>
>
>         <cfif len(StructFind(form, emailfield))>
>         ,#StructFind (form,emailfield)#
>          <cfelse>
>            , ''
>         </cfif>)
>      </cfquery>
>    </cfloop>
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264493
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to