Skip to content

Commit

Permalink
Remove usage of form_show_errors
Browse files Browse the repository at this point in the history
just using field.errors to check if there are errors is enough
  • Loading branch information
stveit committed Nov 13, 2024
1 parent bb22cad commit 114e8ff
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<div id="div_{{ field.auto_id }}" class="ctrlHolder{% 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 field.errors %} error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
<label for="{{ field.id_for_label }}">
{{ field.label}}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
{{ field }}
</label>
{% 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>

0 comments on commit 114e8ff

Please sign in to comment.