QF select element : first line blank ?
| From: | Pierre-Yves Stucki | Date: | Thu, 20 Oct 2005 08:15:22 +0000 |
| Subject: | QF select element : first line blank ? | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21558@lists.php.net to get a copy of this message | ||
Hello all,
I'm quite new to PEAR. I formerly used ADOdb and now would like to go one
with PEAR::DB and QuickForm (together with Template_Sigma).
I'm trying to create a select element, based on data fetched from a
database, but I can't find how to indicate that I want the first line in
my select element to be blank.
You will find below an example of the code I'm using to do it. What do I
have to change in order to add a first line blank ?
Many thanks for your help,
PY.
(...)
// Retrieving list of values from database
$agenda_types = $db->getAssoc("SELECT
id,label FROM
agenda_type
ORDER BY label");
(...)
// Création of the form
$form = new HTML_QuickForm('formRecherche', 'POST');
(...)
// Adding the select element to the form
$form->addElement('select', 'type', 'Type :', $agenda_types);