php - option tags created from Zend_Form_Element_Select wrong -
i'm using zend_form_element_select create select list, when view source, options tags this:
<select name="things" id="things"> <option value="thing1" label="thing 1">thing 1</option> <option value="thing2" label="thing 2">thing 2</option> <option value="thing3" label="thing 3">thing 3</option> </select>
the label attribute doesn't need in there. has no use being in there. value should match what's in label. here's code used:
$things = new zend_form_element_select('things'); $things->setlabel('things:'); $things->setrequired(true); $things->addmultioptions(array( 'thing1'=>'thing 1', 'thing2'=>'thing 2', 'thing3'=>'thing 3' )); $this->addelement($things);
am going wrong or way zend works , have deal it?
the array pass in takes form value=>label, want do
$things->addmultioptions(array( 'thing 1'=>'thing 1', 'thing 2'=>'thing 2', 'thing 3'=>'thing 3' ));
Comments
Post a Comment