ZF2-290: All the <select> <option>s are disabled
Description
Component: Zend\Form\View\Helper\FormSelect
If I create select element using this:
$this->add($factory->createElement(array(
'name' => 'role',
'attributes' => array(
'label' => 'Role:',
'type' => 'select',
'options' => array(
'foo' => array (
'value' => 'Foo Option',
'label' => 'Foo label',
'selected' => TRUE,
'disabled' => FALSE
),
'bar' => array (
'value' => 'Bar Option',
'label' => 'Bar label',
),
),
),
)));
I get the following output: bal blaBar bla
The problem is that in XHTML the option is disabled both for disabled="" & disabled="disabled"
I suggest to remove the attribute if disabled = FALSE or its absent
Comments
Posted by Michael Ben-Nes (mbn_18) on 2012-05-07T07:53:01.000+0000
Same goes for the selected="". The attribute should not appear unless it is the selected: selected="selected"
Posted by Matthew Weier O'Phinney (matthew) on 2012-05-08T21:56:06.000+0000
Resolved in my feature/forms branch.