We have a form with some optional values, which are contained in a dropdown list. When a new user opens the form, the default value on the dropdowns should be '-select-'. The value that the user picks gets sent to our database. This all works fine right now, except we do not have '-select-' listed as the first option, the default is instead the first option as listed in our database.
I am trying to add '-select-' but I receive a database error when I submit the form with '-select-' still chosen.
<div class="control-group">
<label class="control-label">Pricing Profile: </label>
<div class="controls">
<?php
echo form_dropdown('pricing_profile_id', $pricing_profiles,
$profile->pricing_profile_id,' class="span3" id="pricing_profile_id" ');
?>
</div>
</div>
I tried adding in this text above the "echo form_dropdown" but it does not seem to work:
array_unshift($pricing_profiles, array(0 => "-select-"));
Thanks