开发者

Zend Form Multiselect Question

开发者 https://www.devze.com 2022-12-15 07:25 出处:网络
The following is a drop down menu I am trying to add to a Zend Form.Currently the value of the form is 0 for Running and 1 for Triathlon.Instead I want the values to be the same as the labels.What am

The following is a drop down menu I am trying to add to a Zend Form. Currently the value of the form is 0 for Running and 1 for Triathlon. Instead I want the values to be the same as the labels. What am I doing wrong? I checked Google but seems like I am doing it right. I have checked this against another one and they seem to be the same.

   $types = array('Running'=>'Running', 'Triathlon'=>'Triathlon');

    $type = new Zend_Form_Element_Select('type');
    $type->setLabel('Type')
          ->setRequired(true) 
          ->addFilter('StripTags') 
          ->addFilter('StringTrim') 
          ->addValidator('NotEmpty');
    $type->setMultiOptions($开发者_如何学JAVAtypes);


The issue was outside this code. The form was the wrong one.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号