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: price:
orange : qty: price:
>
>
> I could ad
> 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 quote
Wolf wrote:
Andras,
Apples
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):
Apples
that way you can easily fish out the quantities when looping the
selected items (example mostly ignores input
-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,
Apples
Will get you where you need to go on the HTML side of things
Andras,
Apples
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 force users to change the values, but you also
keep your arrays intact and easier (IMHO) to deal with.
Wolf
Andra
5 matches
Mail list logo