Reputation: 43
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>
Upvotes: 0
Views: 826
Reputation: 43
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...
Upvotes: 2