Welcome Guest, Not a member yet? Register   Sign In
form_dropdown: insert blank?
#1

[eluser]ShawnMA[/eluser]
Using the following code:

Code:
<?php  
            $cities_options = array();
            foreach($cities as $city){
            $cities_options[$city->city_id]=$city->city_full;
            }
            echo "<td>" . form_dropdown('cVenueCity', $cities_options, null, 'id="cVenueCity"') . "</td>";
        ?&gt;


Is it possible to add a beginning value such as -- or "Select City" to the drop down?

Thanks.
#2

[eluser]spider pig[/eluser]
Yes Shawn.

Just add the following to the array first:
Code:
$cities_options[''] = 'Select City';




Theme © iAndrew 2016 - Forum software by © MyBB