Answer the question
In order to leave comments, you need to log in
How can each radio set its own id?
Here is the code:
<?php $orders->status = '0'; echo $form->field($orders, 'status')->radioList([
'0' => 'Физическое лицо',
'1' => 'Юридическое лицо',
]);?>
Answer the question
In order to leave comments, you need to log in
Good morning.
You can assign an id to each radio like this
<?= $form->field($model, 'test')->radioList([1 => 'test1', 2 => 'test2'], [
'item' => function($index, $label, $name, $checked, $value){
return Html::radio($name, false, ['id' => 'id_' . $index, 'label' => $label]);
}
])->label(false) ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question