You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Blake Day <bl...@artistrystudios.com> on 2002/04/20 05:56:45 UTC

array of form variables

In my application, I have a shopping cart screen from which I need to allow
users to update quantities.  Each line item in the shopping cart has a
quantity textbox.  Each form field is named "SKU_qty" such that the quantity
textbox for an item with SKU ABC123 would be "ABC123_qty".  This seems ugly
in my opinion, and I was wondering if there was any alternative.  In PHP,
you can create form variables resembling this: "quantities[SKU]" so that the
form variable name in the above example would be "quantities[ABC123]".

My hope is that there is a way to kind of iterate through every quantity
value to update the contents of the shopping cart.  Right now, I'm iterating
through each SKU that is currently in the cart and adding "_qty" to the end
of the SKU to determine the value of the form variables.  Assuming this
makes some sense, do alternatives exist?

Michael Blake Day
Artistry Studios - e-commerce design, implementation and hosting
email: mday@artistrystudios.net



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>