mardi 22 décembre 2015

How to make Yii2's checkbox label not clickable?

I need to disable the possiblity to check the checkbox by clicking on the label. User should be able to check the checkbox only on clicking the box itself. I need to assign different action to click on label. How should I do that?

This is my code atm:

echo $form->field($model, 'accept')->checkbox(['template' => '{input}{beginLabel}{labelTitle}{endLabel}']);

That is something that supposed to work in Yii 1.x, but is not working in Yii2.




Aucun commentaire:

Enregistrer un commentaire