Skip to content
This repository has been archived by the owner on Jul 10, 2020. It is now read-only.

Radios inline in horizontal form #67

Closed
Paul75 opened this issue Apr 1, 2014 · 2 comments
Closed

Radios inline in horizontal form #67

Paul75 opened this issue Apr 1, 2014 · 2 comments
Labels

Comments

@Paul75
Copy link

Paul75 commented Apr 1, 2014

Hello,

In your example I see :
->add(array(
'name' => 'optionsRadios',
'type' => 'MultiCheckbox',
'options' => array(
'value_options' => array(
array('label' => '1','value' => 'option1', 'attributes' => array('id' => 'inlineCheckbox1')),
array('label' => '2','value' => 'option2', 'attributes' => array('id' => 'inlineCheckbox2')),
array('label' => '3','value' => 'option3', 'attributes' => array('id' => 'inlineCheckbox3'))
)
)
))

It's for Multicheckbox, when I do the same with Radio ? I want to have Radio inline.

Thanks

@sirkohli
Copy link

I solved this with the follwing settings: (Bootstrap 3)

->add(array(
    'name' => 'optionsRadios',
    'type' => 'radio',
    'options' => array(
        'value_options' => array(
            array('label' => '1','value' => 'option1', 'attributes' => array('id' => 'inlineCheckbox1')),
            array('label' => '2','value' => 'option2', 'attributes' => array('id' => 'inlineCheckbox2')),
            array('label' => '3','value' => 'option3', 'attributes' => array('id' => 'inlineCheckbox3'))
        ),
        /*** added these ***/
        'disable-twb' => true,
        'label_attributes' => array(
            'class' => 'radio-inline'
        )
        /*** end added ***/
    )
));

@phgeek
Copy link

phgeek commented Mar 5, 2015

Thanks @sirkohli it helped me. But it affects all labels, how can I get the main label without the class "radio-inline". The "My Radio" label:

$this->add(array(
            'name' => 'my-radio',
            'type' => 'Radio',
            'options' => array(
                'label' => 'My Radio',
                'value_options' => array(
                    1 => '#1',
                    2 => '#2,
                ),
                'disable-twb' => true,
                'label_attributes' => array(
                    'class' => 'radio-inline'
                ),
            ),
        ));

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants