English 中文(简体)
显示从Zentd_form回收的 com箱的内容
原标题:display the content of a combobox recover from Zend_form

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 
        ));

我想检索 com体的内容,但当一读echo($busername)时。 i 检索 com贝箱的价值。 因此,如何显示 com船箱的内容

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);
    }
最佳回答

如果你想从所选办法中重新显示案文,你可使用getMultiOption/

if ($form->isValid($formData)) { //Si le formulaire passe la validation
    $v         = $form->getValues();
    $busername = $v[ Busername ];

    echo "You selected $busername which is called " . 
         $form->getElement( Busername )->getMultiOption($busername) . 
          <br /> ;
}
问题回答

暂无回答




相关问题
WPF Datagrid, Setting the background of combox popup

I would like to change the color of the popup background when using a DatagridComboboxColumn in the WPF Toolkit datagrid. I ve edited the Template for a normal Combobox and it works great for selected ...

How to insert ComboBox item into ListBox? [winforms]

The question is very simple, How to insert ComboBox selected item into ListBox using c#? I have tried with this: listbox.Items.Add(combobox.SelectedItem); and some other permutations but it always ...

How do I bind a ComboBox to a one column list

I ve seen how to bind a ComboBox to a list that has columns like this: ItemsSource="{Binding Path=Entries}" DisplayMemberPath="Name" SelectedValuePath="Name" SelectedValue="{Binding Path=Entry}" But ...

Wpf Combobox Limit to List

We are using Wpf Combobox to allow the user to do the following things: 1) select items by typing in the first few characters 2) auto complete the entry by filtering the list 3) suggesting the first ...