PHP form option values
Butters
CA Icrontian
I'm trying to set up a shopping cart, (it is actually for a quote system) that is using a PHP array to set the forms. However, I do not want to use a database and I want everything to be PHP based.
The problem is that I want to display values for a particular product. That is, the 'ID' and the 'NAME' of the produt.
Currently I am able to show the ID, because the form uses this value.
I want to be able to have the product NAME show up too.
Here is the link to the testing site
I've tried to create a hidden field that will show the corresponding NAME to the selected ID, but I am unsuccessful.
Is there anyway I could have the 'ID' and corresponding 'NAME' show up in form?
The problem is that I want to display values for a particular product. That is, the 'ID' and the 'NAME' of the produt.
Currently I am able to show the ID, because the form uses this value.
I want to be able to have the product NAME show up too.
Here is the link to the testing site
I've tried to create a hidden field that will show the corresponding NAME to the selected ID, but I am unsuccessful.
Is there anyway I could have the 'ID' and corresponding 'NAME' show up in form?
0
Comments
[php]
<option value="2200250">AUREOMYCIN 90 </option>
[/php]
Excuse my lack of understanding.. but Im trying to figure out what you are having a problem with.
In the cart, it only will show the ID. I want to be able to have the name show up too.
So far this is what it is displaying.
[php]<option value="2200250.AUREOMYCIN 90">AUREOMYCIN 90 </option>[/php]
Then on the cart page have something like:
[php]
$product = explode('.',$_POST[product])
[/php]
It'll split the value of the form into in array index every time it encounters a period so you'll have:
id = $product[0]
name = $product[1]
Hope that helps a bit.