Wednesday, 11 September 2013

Select list with price value and name

Select list with price value and name

I have a form that works great with a review stage. What I want to do is
not add a price to mix. Say I have a dropdown like this
<select name="DriverShaft" class="select">
<option value="" selected="selected">Select Shaft</option>
<option value="LE- light weight graphite weakest flex">LE- light weight
graphite weakest flex</option>
<option value="LW- Light weight graphite weak flex">LW- Light weight
graphite weak flex</option>
<option value="LM- Light weight graphite medium flex">LM- Light weight
graphite medium flex</option>
<option value="LR- Light weight graphite regular flex">LR- Light weight
graphite regular flex</option>
<option value="GR- Medium weight graphite regular flex">GR- Medium
weight graphite regular flex</option>
<option value="SS- Light weight graphite stiff flex">SS- Light weight
graphite stiff flex (low torque)</option>
<option value="TS- Medium weight graphite stiff flex">TS- Medium weight
graphite stiff flex</option>
<option value="SX- Light weight graphite X-stiff">SX- Light weight
graphite X-stiff</option>
<option value="KS- Light weight steel stiff flex">KS- Light weight steel
stiff flex</option>
<option value="KR- Light weight steel regular flex">KR- Light weight
steel regular flex</option>
<option value="DX- Heavy weight steel extra stiff">DX- Heavy weight
steel extra stiff</option>
<option value="DS- Heavy weight steel stiff flex">DS- Heavy weight steel
stiff flex</option>
</select>
and on the review I echo the option like so:
echo (!empty($_REQUEST['DriverShaft'])) ? "<div class='reviewItem'><span
class='reviewTitle'>Shaft:</span>{$_REQUEST['DriverShaft']}</div>" : "";
This would then show me the shaft select if they chose one. How do I add a
price value to each shaft though? So on the review it shows the name of
the shaft but I can also get a price from their selection to add up?

No comments:

Post a Comment