Skip to content

Commit

Permalink
Merge pull request #3066 from Uninett/show-field-errors-in-helpfield
Browse files Browse the repository at this point in the history
Ensure field errors are always rendered in template for HelpField
  • Loading branch information
podliashanyk authored Oct 2, 2024
2 parents 58d9a2f + 4d9ba09 commit 0167a07
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% if field.is_hidden %}
{{ field }}
{% else %}
<div id="div_{{ field.auto_id }}" class="ctrlHolder{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.errors and form_show_errors %} error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
<div id="div_{{ field.auto_id }}" class="ctrlHolder{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.errors %} error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
{% if field.label %}
{% if field|is_checkbox %}
{{ field }}
Expand All @@ -23,14 +23,12 @@
{{ field }}
{% endif %}

{% if form_show_errors %}
{% for error in field.errors %}
<small id="error_{{ forloop.counter }}_{{ field.auto_id }}"
class="errorField">
{{ error }}
</small>
{% endfor %}
{% endif %}
{% for error in field.errors %}
<small id="error_{{ forloop.counter }}_{{ field.auto_id }}"
class="errorField">
{{ error }}
</small>
{% endfor %}

</div>
{% endif %}

0 comments on commit 0167a07

Please sign in to comment.