Radio & Multicheckbox Problem with selected & disabled attributes #4180

Closed
wants to merge 8 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

Chintanvpatel commented Apr 4, 2013

Please refer this issue
zendframework#4136

From this fix we can do (disable whole group of radio & multicheckbox)
$form->get('gender')->setAttribute('disabled', 'true');

@Chintanvpatel Chintanvpatel commented on the diff Apr 4, 2013

library/Zend/Form/View/Helper/FormMultiCheckbox.php
$inputAttributes = $attributes;
$labelAttributes = $globalLabelAttributes;
+ $selected = isset($inputAttributes['selected']) && $inputAttributes['type'] != 'radio' && $inputAttributes['selected'] != false ? true : false;
+ $disabled = isset($inputAttributes['disabled']) && $inputAttributes['disabled'] != false ? true : false;
@Chintanvpatel

Chintanvpatel Apr 4, 2013

Contributor

This will apply to both radio button & multicheckbox for disable attribute.

@Chintanvpatel Chintanvpatel commented on the diff Apr 4, 2013

library/Zend/Form/View/Helper/FormMultiCheckbox.php
$inputAttributes = $attributes;
$labelAttributes = $globalLabelAttributes;
+ $selected = isset($inputAttributes['selected']) && $inputAttributes['type'] != 'radio' && $inputAttributes['selected'] != false ? true : false;
@Chintanvpatel

Chintanvpatel Apr 4, 2013

Contributor

This is only for multicheckbox.

Owner

weierophinney commented Apr 12, 2013

Please provide a unit test.

@weierophinney weierophinney added a commit that referenced this pull request Apr 15, 2013

@weierophinney weierophinney Merge pull request #4180 from Chintanvpatel/radiofix1
Radio & Multicheckbox Problem with selected & disabled attributes
ed81c03

@weierophinney weierophinney added a commit that referenced this pull request Apr 15, 2013

@weierophinney weierophinney [#4180] CS fixes
- Per php-cs-fixer
2fffe07

@weierophinney weierophinney added a commit that referenced this pull request Apr 15, 2013

@weierophinney weierophinney Merge branch 'hotfix/4180' into develop
Forward port #4180
5718dfc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment