This should be simple but my code keeps failing. I have a form that sends
multiple values for the same form field. They arrive at my processing
template as two lists; one for the item being ordered and another for
quantity.
Field name Value
-- --
Item
cfif listLen(form.Item) gt 0 and (listLen(form.Item) eq
listLen(form.ItemQty))
cfloop from=1 to=#listLen(form.Item)# index=i
cfoutput
#listGetAt(form.ItemQty,i)# #listGetAt(form.Item,i)#
/cfoutput
/cfloop
/cfif
Justin
Would you be willing to send us a code snippit? I am not quite sure i have a
handle on the problem.
A.
- Original Message -
From: Keith Purtell [EMAIL PROTECTED]
To: KCFusion (E-mail) [EMAIL PROTECTED]
Sent: Thursday, May 02, 2002 11:44 AM
Subject: [KCFusion] Parsing two lists
This
CFIF IsDefined(form.Item) AND IsDefined(form.ItemQty)
cfset ItemArray = ListToArray(Item)
cfset ItemQtyArray = ListToArray(ItemQty)
CFIF ArrayLen(ItemArray) EQ ArrayLen(ItemQtyArray)
CFLOOP FROM=1 TO=#ArrayLen(ItemArray)# INDEX=Idx
Yipes; more solutions than I can shake a stick at! I already tried one of
those suggested an it worked. I'll try the others with efficiency and code
re-use in mind. Thanks a million!
Keith Purtell, Web/Network Administrator
VantageMed Operations (Kansas City)
Email: [EMAIL PROTECTED]
I replied to you yesterday and it never came through
- Original Message -
From: Ron Hornbaker [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 01, 2002 1:37 PM
Subject: RE: [KCFusion] Client side variable storage
Bryan,
Nice code. Just curious: what's the advantage of
The example you sent me is exactly what I coded. The Person function is my
collection and setName function is my Map. The difference is that you don't
need to know the names of your properties to get them back out and you can
choose to output them as an array or a list.
-Original