0

how do i add css class for the auto generated label for a RadioSelect widget

<div>
    {% for rdo in form.category_res %}
        <div class="custom-control custom-radio custom-control-inline">
          {{ rdo }}
        </div>  
    {% endfor %}
</div>

1 Answers1

1

I hope this will help someone in the future.... I rendered my template like this:

{% for choice in form.category_res %}
        <div class="custom-control custom-radio custom-control-inline">
            {{ choice.tag }}
            <label for="{{ choice.id_for_label  }}" class="custom-control-label">{{ choice.choice_label }}</label>
        </div>
{% endfor %}

since I'm using bootstrap, it requires me to add a class to the label for my field with RadioSelect() as a widget for the CSS to work...