Re: checkboxes vs text filed array and hidden variables
| From: | Jason Wong | Date: | Tue, 15 Jan 2002 06:16:55 +0000 |
| Subject: | Re: checkboxes vs text filed array and hidden variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80519@lists.php.net to get a copy of this message | ||
On Monday 14 January 2002 06:03, m. ali wrote:
> Hi
>
> my problem :
> i have to pass the price, and part number which i get from the database to
> the shopping cart so when i select some
> of the items by checking the checkboxes and submit the form i get only the
> last item in the list
>
> i use hidden variables to pass these values to shopping cart.
>
> my code look like this:
>
> echo "<TD><input type=\"checkbox\" name=\"product[]\"
> value=\"$product_id\"></TD>";
> echo "<TD><input type=\"text\" size=\"2\"
> name=\"quantity[$part_number]\"
> value=\"1\" >";
> echo"</TD>";
> echo "<input type=\"hidden\" value=\"$part_number\"
> name=\"part_number\"/>"; echo "<input type=\"hidden\"
> value=\"$discount_price\"
> name=\"discount_price\"/>";
But what is your question? Does the above code work? If not does it give any
error messages? Help us to help you by giving us some details :)
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
The probability of someone watching you is proportional to the
stupidity of your action.
*/