-Original Message-
From: Wolf [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 17, 2006 9:47 PM
To: Andras Kende
Cc: php-general@lists.php.net
Subject: Re: [PHP] Add Multiple Items, Qty to Cart from html form
Andras,
input type=hidden name=item[] value=applesApples input type=text
name
Wolf wrote:
Andras,
input type=hidden name=item[] value=applesApples input type=text
name=qty[] value=0 input type=text name=price[] value=0
a useful addition can be to use the item id in the 'key' of the input names
(and always quoting your element attributes is highly recommended):
input
SNIP
a useful addition can be to use the item id in the 'key' of the input names
(and always quoting your element attributes is highly recommended):
Yes, when I generate my cart I use the itemID as a key field (since the
ID stayed the same but the # in the database could change).
And ALWAYS
On Wed, May 17, 2006 6:59 pm, Andras Kende wrote:
I trying to add multiple items to a shopping cart with selectable
quantity
and price form text field like..
apple : qty: [__] price: [__]
orange : qty: [__] price: [__]
apple : qty: input name=quantity[apple] / price: input
Andras,
input type=hidden name=item[] value=applesApples input type=text
name=qty[] value=0 input type=text name=price[] value=0
Will get you where you need to go on the HTML side of things, then on
the back end you need to process each array. By setting a default value
of 0 for the qty, you
5 matches
Mail list logo