[Django]-How to check if a checkbox is checked in django template

5๐Ÿ‘

โœ…

You need to use checked property by html

<input type="checkbox" name="is_closed" value="closed" {% if 'closed' in 'is_closed %} checked {% else %} '' {% endif %}>
๐Ÿ‘คshafikshaon

1๐Ÿ‘

Check form.field.value: {% if form.checkbox_field.value %}

๐Ÿ‘คrifle2000

Leave a comment