> FORM.ProductID,
> FORM.Qty
> FORM.Option1 (option#count#)
> FORM.Option2
> FORM.Option3
It looks like you wont have any issues with fields like productid and qty
since they are most likely hard coded... so you know their names
The options though are probably built with a cfloop from a query or
something so use the same loop to create params for them and get their
values.
Eg...
....to build them
<cfloop query="myquery">
<input type="checkbox" name="option#currentrow#" value="#column_with_value#"
/>
</cfloop>
.... to check them
<cfloop query="myquery">
<cfparam name="form.option#currentrow#" default="NULL" />
<cfif form['option' & currentrow] NEQ "NULL">
INSERT RECORD HERE USING THE VALUE FROM #form['option' &
currentrow]#
</cfif>
</cfloop>
..:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-----Original Message-----
From: Eric Roberts [mailto:[EMAIL PROTECTED]
Sent: Sunday, February 05, 2006 1:00 AM
To: CF-Talk
Subject: RE: passing multiple values from the same form field
If you have them have the same name, it passes a list. You can do a listlen
on the variable to get the number of values passed and then loop it through
to get values into the tables. If you know what the values are, you can
also do some if then processing to sort them out into the proper tables...
Eric
-----Original Message-----
From: j s [mailto:[EMAIL PROTECTED]
Sent: Friday, 03 February 2006 20:06
To: CF-Talk
Subject: Re: passing multiple values from the same form field
It is for a form which will display a product. That product has options you
can add to. Like Coffee, you can have the option of whole milk/skim/cream,
sugar/equal/brown, caffine/decafe and so on.
I want to pass these options along with the productID and qty.
The possible values that are passed are:
FORM.ProductID,
FORM.Qty
FORM.Option1 (option#count#)
FORM.Option2
FORM.Option3
And so on...
The Options are created dynamic so I don't know how many option groups (ie
milk, sweeatner) I will have for each option (whole, skim, equal, splenda).
This is why I have the input name= option#counter#. Since I'm working with
radio input each group of options must have a unique name so I can select
either whole milk, skim....
whole milk skim milk all have input nmes option1 white sugar, equal all have
input names option2
The sku and qty are stored in a cartTable with a unique key for each line.
Options will be insert in a seperate table which will only store the
optionID and the cartID.
Anyway, I don't know how to pass the many options along with the productID
and qty.
Can you point me to how to do this?
> I have no idea what you are really trying to do. It sounds very
> convoluted.
>
> But hopefully the answer to your question is the array notation for
> form data. It usually is for these kinds of serially numbered fields.
>
>
> #form["fieldname" & counter]#
>
> HTH
>
> --------------
> Ian Skinner
> Web Programmer
> BloodSource
> www.BloodSource.org
> Sacramento, CA
>
> ---------
> | 1 | |
> --------- Binary Soduko
> | | |
> ---------
>
> "C code. C code run. Run code run. Please!"
> - Cynthia Dunning
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:231374
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54