I have created a dynamic form from a table in my database, delivery types. I 
insert the data using the code below

<cfloop 
   index="LoopCount" 
   from=1 
   to=#Val(form.ResCount)#>
   
   <cfif IsDefined("form.wp_select#Evaluate(LoopCount)#")>
   <cfset variables.wp_select="form.wp_select#Evaluate(LoopCount)#">
   <cfset variables.wp_select="#Evaluate(variables.wp_select)#">
   <cfelse>
   <cfset variables.wp_select="no">
   </cfif>
   <cfset variables.wp_delivery_id="form.wp_delivery_id#Evaluate(LoopCount)#">
   <cfset variables.wp_delivery_id="#Evaluate(variables.wp_delivery_id)#">
   <cfset 
variables.wp_delivery_cost="form.wp_delivery_cost#Evaluate(LoopCount)#">
   <cfset variables.wp_delivery_cost="#Evaluate(variables.wp_delivery_cost)#">

<cfquery name=”insert_del” datasource=”#application.dsn#”>
INSERT INTO del_cost (del_cost)
VALUES (cfqueryparam cfsqltype="cf_sql_integer" value="#variables 
wp_delivery_cost #">)
    
</cfloop>

The above code quite rightly inserts a record for each row in my form, however 
I want it only to insert the row which has been selected. 

e.g. User has choice of Premium Delivery: £25.00, Basic Delivery £20.00, he 
selects a radio button next to Basic Delivery. Each delivery option has its own 
id, so differentiating them isn’t a problem; just can’t think how to single 
out the selected record.(mind you it is getting late!)

Thanks

Jason


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318905
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