Skip to content

Checkbox "return_format" isn't working. #81

@voyou-sbeaulieu

Description

@voyou-sbeaulieu

We are trying to get return format "array" from a checkbox but it's always output as value.

We tried this :

->addCheckbox('global_btn_style', ['label' => 'Styles possible','return_format'=>'array', 'allow_custom'=> true,'allow_null'=>false])
            ->addChoices(
                ['default' => COLORDEFAULT], 
                ['primary' => COLORPRIMARY],
                ['secondary' => COLORSECONDARY],
                ['danger' => 'danger'],
                ['text' => 'text'],
                ['link' => 'link']
            )
            ->setDefaultValue(['default','primary','secondary'])

And a simplier one :

->addCheckbox('checkbox_field', [
                'label' => 'Checkbox Field',
                'instructions' => '',
                'required' => 0,
                'conditional_logic' => 0,
                'wrapper' => [
                    'width' => '',
                    'class' => '',
                    'id' => '',
                ],
                'choices' => ['dsfsd'],
                'allow_custom' => 0,
                'save_custom' => 0,
                'default_value' => [],
                'layout' => 'vertical',
                'toggle' => 0,
                'return_format' => 'array',
            ]);

Both aren't working

edit formating

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions