I have been pulling my hair out for god knows how long trying to work this out.
Currently I have a select list (form_dropdown) like this.
<select name="starters">
<option value="">Please Select</option>
<option value="0" >Brochettes</option>
<option value="1" >Grilled mackerel</option>
<option value="2" >Risotto cake</option>
<option value="3" >Calamari rings</option>
<option value="4">Parma ham parmesan</option>
</select>
What I need to do Is pass into this form_dropdown is a Price Value, so I can have a dynamic price calculator on the website.
<select name="starters">
<option value="" price="100">Please Select</option>
<option value="0" price="22">Brochettes</option>
<option value="1" price="342">Grilled mackerel</option>
<option value="2" price="42">Risotto cake</option>
<option value="3" price="52">Calamari rings</option>
<option value="4" price="22">Parma ham parmesan</option>
</select>
Is there any way I can do this? Im really stuck for dead lines and I thought this would be possible in code igniter.
My code so far, as you can see I have a price, but I need to pass it into the option.
echo form_label("APPETISERS", "appetisers");
$array = array();
foreach($appertisers as $row ){
$array[] = $row->product;
$price[] = $row->price;
}
$array = array_merge(array('' => 'Please Select'), $array);
echo form_dropdown('appetisers', $array);