ZF2-290: All the <select> <option>s are disabled


Component: Zend\Form\View\Helper\FormSelect

If I create select element using this:

        '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


Same goes for the selected="". The attribute should not appear unless it is the selected: selected="selected"

Resolved in my feature/forms branch.