I am adding a select element to a Zend_Form instance as follows:
$user = $form->createElement('select','user')->setLabel('User: ')->setRequired(true);
foreach($users as $u)
{
if($selected == $u->id)
{
$user->addMultiOption($u->id,$u->firstname.' '.$u->lastname);
//*** some way of setting a selected option? selected="selected"
}
else
$user->addMultiOption($u->id,$u->firstname.' '.$u->lastname);
}
I have been searching the docs but cannot find a simple way of pre-setting an option of the select element to 'selected'.