Another QuickForm question
| From: | Charles Kline | Date: | Thu, 13 Mar 2003 23:55:48 +0000 |
| Subject: | Another QuickForm question | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-4221@lists.php.net to get a copy of this message | ||
When creating a select menu, I am using this syntax:
$form_get_p->addElement('select', 'person', 'Edit Person:', $qper);
$select = &$form_get_p->getElement('person');
$select->setSize(1);
$select->setMultiple(false);
where $qper contains an ASSOC ARRAY that contains ID and NAME from the table. This has typically worked for me and QuickForm has used the value of ID for the value="" and the value in NAME for the display in the select.
This time (not sure why), in this form, the value is being set like 1 - n counting up for each record returned. Is there a way I can implicitly make the tbl ID field the value and the NAME what gets displayed in the menu?
Thanks,
Charles
BTW. Here is my query if that helps.
$sql = "SELECT id, concat(fname, ' ', lname, ' ', degree1) as name".
" FROM tbl_personnel WHERE MATCH (fname,lname) AGAINST ('" . $attributes['searchstring'] . "')";