default option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I am building some select menu's dynamically from a mysql database and
am courous how to give the menu a default option "Choose".

Below is what I have so far for one of my menu's.

Thank you in advace.

                    <select name="market" id="market"
onchange="javascript:get(this.parentNode);">
                    <?php
                        foreach($market_prefix as $key => $value)
                            {
                            $selected = '';
                            if($value == $market)
                            {
                            $selected = 'selected';
                            }
                            echo("<option value=$value $selected
>$value : $market_name[$key]");
                            }
                            ?>
                    </select>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux