What are the hidden inputs for?

Anyway, since you have these:

<input name="quant_#getItems.xref_inv_id#" type="text"
id="quant=#getItems.xref_inv_id#" value="0" size="4">

you can loop through them to get each value:

<cfloop collection="#FORM#" item="CurrentFormField">
<cfif CurrentFormField contains "quant_">
<!---
FORM[CurrentFormField] has the value from the form post
and the XRefInvID is in the name of the element
We can use ListLast() to get that ID id if the ID has no underscores in it
--->
<cfset ThisXrefInvID = ListLast(CurrentFormField,"_")>
<!---
make the next var something based on ThisXrefInvID,
maybe a struct  - I'll leave this up to you
--->
<cfset SomeVariableOrArrayHere = FORM[CurrentFormField]>
</cfloop>


On 12/29/06, Gerald Weir <[EMAIL PROTECTED]> wrote:
> Hello,
> We need a form that is a bit different from the examples I've been able to 
> find so far. I am querying the db to get a list of all the products for this 
> page and I want it to look like this to the consumer (some numbers are same 
> for first 4 digits but then change for different size):
>
> 4353-H5 - 6-8-10-12-14       Quantity __
> 4353-P5 - 12-14-16-18-20     Quantity __
> 4354-A - ALL-SIZES           Quantity __
> 4355-AA - XS-S-M             Quantity __
> 4355-BB - M-L-XL             Quantity __
> 4356-H5 - 6-8-10-12-14       Quantity __
> .... etc, etc,
> Submit   Reset
>
> The idea is that we want to present a list of 50 or so items to choose from 
> and have the consumer enter ALL quantities at the same time and hit the 
> SUBMIT button once.  The consumer in most all cases will choose 20 to 30 
> items from the page and want to have quantities for each up to 99.
>
> Here's my code for presentation of the items but I don't really know how to 
> make the action page write each item separately with it's own quantity to an 
> array or SESSION.CART.  In this version I am using the xref_inv_id which is a 
> number such as 1857, 1858, etc.
>
> <form name="form" method="post" action="formDump.cfm">
> <cfoutput query="getItems">
>   <tr>
>     <td>
>       #getItems.design#-#getItems.size_code#  -  #getItems.size_unit#
>      </td>
>      <td align="center">
>       <input name="quant_#getItems.xref_inv_id#" type="text" 
> id="quant=#getItems.xref_inv_id#" value="0" size="4">
>       <input name="#getItems.xref_inv_id#" type="hidden" 
> id="#getItems.xref_inv_id#" value="">
>      </td>
>   </tr>
>
> </cfoutput>
>      <tr>
>         <td colspan="2">
>           <input name="Submit" type="submit" class="buttons" value="add to 
> cart">
>           <input name="Clear" type="reset" class="buttons" value="clear 
> numbers">
>         </td>
>     </tr>
>   </table>
> </form>
>
> If someone can enlighten me as to how I can write the non-zero quantities 
> chosen to an array that I can then display to the user on the next page as a 
> simple list I would appreciate it very much.  I also want to have a total of 
> the items in the end so that I can charge them $1.00 per item ordered.  So, 
> if a consumer orders 327 items they will see a total amount of $327.00.
>
> Regards and thanks, Jerry
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:265286
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to