0
I got the following Form
down below.
If I pass checked=checked
it brings the last selected option.
But, I want for example that the first option is preselected, some hint/suggestion?
<?php
echo "<label> Selecione o tipo de entrada</label>";
echo $this->Form->input('tipo', array(
'type' => 'radio',
'before' => '<div ' . $style . '>',
'separator' => '</div><div ' . $style . '>',
'options' => array(
'D' => $this->Html->image(
"botoes/dinheiro.png", array(
"alt" => "Dinheiro",
"title" => "Dinheiro",
"style" => "height: 32px")),
'P' => $this->Html->image(
"botoes/porcento.png", array(
"alt" => "Porcentagem",
"title" => "Porcentagem",
"style" => "width: 28px")),
'H' => $this->Html->image(
"botoes/hora.png", array(
"alt" => "Hora",
"title" => "Hora",
"style" => "height: 32px"))),
'id' => 'tipo',
'label' => 'Dinheiro/Porcento',
'style' => '',
'legend' => false,
'onclick' => "formular()",
'checked' => 'checked',
'required'));
?>
Is not duplicate of How to bring the radio button checked with a Bank result
It’s not enough to do
'value' => "D"
or something like that?– Woss
Wow, I think it’s the tired kkk' is just that ! I was trying to put
checked = 'D'
so I wouldn’t, thank you Anderson, if you want to put the answer, I mark it as correct !!– Marcos Henzel