Answer the question
In order to leave comments, you need to log in
How to write down the username on clicking the checkbox?
Friends, please help.
There is
<?=$form->field($checklist, 'agreed')
->checkbox([
'label' => "Чекнул пункт: <b style=\"color:red\">".$checklist->check_user."</b>",
'labelOptions' => [
'style' => 'padding-left:20px;'
],
'disabled' => false
]);
?>
Yii::$app->user->identity->username
Answer the question
In order to leave comments, you need to log in
Good evening.
This is how you can handle the "click" on the checkbox
<?=
$form->field($model, 'attribut')->checkbox([
'onclick' => '
alert($(this).val())
'
])
?>
But I can't figure out how to assign a value to $checklist->check_user using js.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question