cakephp-plugin-boost_cake icon indicating copy to clipboard operation
cakephp-plugin-boost_cake copied to clipboard

How do I set a default radio button checked with boostcake?

Open ghost opened this issue 11 years ago • 2 comments

I want to set "Medium" as the default radio button

echo $this->Form->input('priority', array(
        'type' => 'radio',
        'before' => '<label class="col col-md-3 control-label">Priority</label>',
        'legend' => false,
        'class' => 'radio-btn',
        'options' => array(
            1 => 'High',
            2 => 'Medium', 
            3 => 'Low'
        )
));

ghost avatar Mar 23 '14 05:03 ghost

You can try:

    echo $this->Form->input('priority', array(
        'type' => 'radio',
        'before' => '<label class="col col-md-3 control-label">Priority</label>',
        'legend' => false,
        'class' => 'radio-btn',
        'options' => array(
            1 => 'High',
            2 => 'Medium', 
            3 => 'Low'
        )
      'value' => 'Medium'
    ));

develmts avatar Apr 25 '14 12:04 develmts

Thank you, it works :)

tino013 avatar May 30 '15 09:05 tino013