checkbox.html 611 B

1234567
  1. {% comment %}
  2. Include a hidden field of the same name to ensure that unchecked checkboxes
  3. are always included in the submitted form data. Omit fields names
  4. _selected_action to avoid breaking the admin UI.
  5. {% endcomment %}
  6. {% if widget.name != '_selected_action' %}<input type="hidden" name="{{ widget.name }}" value="">{% endif %}
  7. <input type="checkbox" name="{{ widget.name }}"{% if widget.value != None %} value="{{ widget.value|stringformat:'s' }}"{% endif %} {% include "django/forms/widgets/attrs.html" %} class="form-check-input{% if 'class' in widget.attrs %} {{ widget.attrs.class }}{% endif %}">