Answer the question
In order to leave comments, you need to log in
Why does validation in radioList stop working if I set my own 'tag'?
By default, the "tag" parameter is "div", in which case the validation works well, if nothing is selected from the list, then a warning appears, and if selected, it lights up green.
But if you set another tag, then it swears in both cases, whether I chose a value or not ....
How to set up validation so that everything works?
<?= $form->field($model, 'model_param')
->radioList($array,
[
'tag' => 'section',
'item' => function ($index, $label, $name, $checked, $value) {
return Html::radio($name,
$checked,
[
'value' => $value,
'label' => $label
]
);
},
]
)
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question