Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ChoiceFormField::isDisabled for checkbox #8348

Closed
@tamirvs

Description

@tamirvs

Checking if a checkbox is disabled using isDisabled() returns false even when the checkbox really is disabled.

I looked through the code and I think the problem is this line because when I dumped the ChoiceFormField checkbox object this is what I got:

['options':private] =>
    array {
        array {
            'value' => 1,
            'disabled' => true
        }
    }
['value':protected] =>
    null

So obviously this $option['value'] == $this->value is false..
If when building the form I add an option 'value' => null to the checkbox form it works just fine.

Shouldn't the checkbox isDisabled function be different than the one for other choice inputs?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions