I have a form with a combobox
/*Business user type*/
$Busertype = new Zend_Form_Element_Select("Busertype");
$Busertype ->setLabel('Business user type')
->addFilter('StripTags') //StripTags : Enlève les caractères HTML
->setRequired(true)
-> setMultiOptions(array(
'0' => '-Select your business type-',
'1' => 'Owner',
'2' => 'Suplier',
'3' => 'Representative',
'4' => 'Shop'
));
I want to retrieve the contents of the combobox, but when i do echo($busername) i retrieve the value of the combobox. So how can i display the content of the combobox
Part of the action
$form = new Application_Form_Inscriptionbu();
$this->view->form = $form; //nous assignons le formulaire à la vue pour affichagee
if ($this->getRequest()->isPost()) { //Le formulaire est-il posté ?
$formData = $this->getRequest()->getPost(); // récupère les infos des formulaires
if ($form->isValid($formData)) { //Si le formulaire passe la validation
$v = $form->getValues();
$busername =$v['Busername'];
echo($busername);
}
If you would like to redisplay the text from the option selected, you can use
getMultiOption.