QF - Add empty option top of the list

From: Date: Wed, 12 Jul 2006 14:55:36 +0000
Subject: QF - Add empty option top of the list
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-24623@lists.php.net to get a copy of this message
Hello, How can I add an empty option to the top of the list? $query = "
    SELECT m.module_id AS mid, m.module_name AS mname
    FROM Modules m
    WHERE m.is_active = 1
    ORDER BY m.module_name
"; $result = $mdb2->query($query); $modules = $result->fetchAll('', $rekey = true); $select =& $form->addElement('select', 'modules', $strAdminRightsModules, $modules); But I'd like an empty option. Maybe: $select->addOption('', ''); $form->setDefaults(array('modules' => '')); ? (but it's at the bottom of the list) Thanks a lot ZoTyA

« previous php.pear.general (#24623) next »