File: field_errors_block.html

package info (click to toggle)
python-crispy-bootstrap5 2025.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 724 kB
  • sloc: python: 2,035; sh: 6; makefile: 3
file content (12 lines) | stat: -rw-r--r-- 451 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 %}