[eluser]nealumney[/eluser]
I have an array of items I want to include as a 'drop down' and so I have (within my view) the following code:
echo form_dropdown('manufacturer', $mftrs);
all is well and presents a list of manufacturers for the user to select from. However, I need the first item to be a 'Please select ... ' item, and have this as an entry in the $mftrs' array. What I want to do is to have this 'selected' rather than just appear in the list somewhere. I could of course manually do the following:
<select name="manufacturer">
<option value="">Please select ...</option>
<?php
foreach ($mftr $key as $row)
{ ?>
<option value="<?php echo $key ;?>" ><?php echo $row ; ?></option>
<?php } ?>
</select>
Is there anyway of using the form_dropdown method with an array to choose the selected item?
Thanks,
Neal