try something like this.. UNTESTED of course
<cfloop from="1" to="#listlen(session.mealproductid)#" index="i">
<cfset session.meals = listappend(session.meals,
listgetat(session.MealsQtyList,i) & "-" &
listgetat(session.MealsQtyList,i)) />
</cfloop>
On 10/8/07, Blufeet <[EMAIL PROTECTED]> wrote:
> Hi Everyone-
>
> I am working on a registration page where people can specify additional meal
> tickets as a quantity. What I need to be able to do is take this information
> that is passed to form a variable called ProductID. I will pass this variable
> to a shopping cart to add the item to the cart.
>
> The variable needs to be in the format of "ProductID-Quantity".
>
> The form looks similar to this
>
> <cfoutput query="getMeals">
> <cfset MealField = "Meal" & EventID & "Qty">
> <tr<cfif (CurrentRow-1) mod 2> bgcolor="##F3F1ED"</cfif>>
> <input type="hidden" name="MealIDs" value="#EventID#">
> <td align="center">
> <input type="text" name="#MealField#"
> value="#IIf(isDefined("Session."&MealField),"Session."&MealField,0)#"
> size="2" maxlength="3"> x</td>
> <td>
> #Name#</td>
> <td>#DateFormat(Dte,"dddd mmmm d")#,
>
> #LCase(TimeFormat(StartT,"h:mmtt"))#-#LCase(TimeFormat(EndT,"h:mmtt"))#</td>
> <td>@ #DollarFormat(IIf(Session.Member,"CostMember","CostNonMember") +
> (confPriceAdd * isEarlyBird))# USD</td>
> </tr>
> </cfoutput>
>
> Once this is submitted, I can get two lists one of the quantity and I query
> the database to get the product IDs of the meals.
>
> I am able to get two lists from this form.
>
> Session.MealProductID: 4033,4031,4029
> Session.MealsQtyList: 2,5,4
>
> Is there anyway I can then take these two lists and create the following?
>
> Session.Meals: 4033-2;4031-5;4029-4
>
> Any advice would be appreciated.
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf
Archive:
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3092
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15