View Single Post
  #1 (permalink)  
Old 03-27-2008, 12:57 PM
frocco frocco is offline
Junior Member
 
Join Date: Mar 2008
Posts: 2
Default How do I fill a zend::form select from db?

Hello,

First post here, so not sure if in the right form.
I have a $result from fetchPairs.
$result = $db->fetchPairs($sql);

How do I assign this to the code below?
$assignedTo = new Zend_Form_Element_Select('assignedTo');

nevermind, I found the answer.

$assignedTo = new Zend_Form_Element_Select('assignedTo');
$assignedTo->setLabel('Assigned to')
->setMultiOptions($result)
->setRequired(true)->addValidator('NotEmpty', true);
Thanks
Frank

Last edited by frocco : 03-28-2008 at 01:55 PM.
Reply With Quote