File: field_errors_block.html

package info (click to toggle)
python-crispy-bootstrap4 2025.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 656 kB
  • sloc: python: 1,956; sh: 6; makefile: 4
file content (12 lines) | stat: -rw-r--r-- 457 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
{% if form_show_errors and field.errors %}
    {% if field.errors.field_id %}
         {# Django 5.2+ #}
         <div id="{{field.errors.field_id}}_error" class="invalid-feedback">
     {% else %}
         <div id="{{field.auto_id}}_error" class="invalid-feedback">
     {% endif %}
    {% for error in field.errors %}
        <p id="error_{{ forloop.counter }}_{{ field.auto_id }}"><strong>{{ error }}</strong></p>
    {% endfor %}
    </div>
{% endif %}