In order to style the custom checkboxes you must have a class on parent, because CSS
does not allow a parent selector. For that you can modify the View
/
Go to wwwroot\[sitecore-instance]\Views\FormBuilder\FieldTemplates\CheckboxList.cshtml
and in foreach loop you will get its Markup. Update it with your CSS class and add a tag enclosed
Make sure to document this change, or you will face troubles in Sitecore version upgrades.
@foreach (var item in Model.Items)
{
<label class=" @Model.CssClass-group" >
<input type="checkbox" class="@Model.CssClass" name="@Html.NameFor(m => Model.Value)"@if (item.Selected)
</label>
@Html.NameFor(m => Model.Value)
}