Zend Form Multiselect Question
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.
精彩评论