Question T9964
Visible to All Users

Checkbox toggle on checkbox-label click

created 2 years ago

Hello SurveyJS Team,
if you click the label or inside of the row of a checkbox the checkbox will be toggled. As shown in the screenshot, taken in the checkbox demo https://surveyjs.io/Examples/Library/?id=questiontype-checkbox&platform=jQuery&theme=defaultV2

Clipboard-File-2.png

Is there a way to only toggle the checkbox if you click directly on the checkbox and do nothing when clicking on the label.

Answers approved by surveyjs Support

created 2 years ago (modified 2 years ago)

Hello,

You can use css style: "pointer-events: none" to achieve this behavior. We created two examples: https://plnkr.co/edit/r4kjA5G6GXiRGP4i, https://plnkr.co/edit/cU1cBp6jgwNlMuxb, with custom CSS that either uses existing classes or those added with custom code.

Thanks,
Dmitry
SurveyJS Team