Skip to content

Commit

Permalink
Show form errors below label.
Browse files Browse the repository at this point in the history
  • Loading branch information
thisismeonmounteverest committed May 7, 2024
1 parent 7a8f6f1 commit 2d00ece
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions templates/rox_form_theme.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@

{% block form_widget_simple -%}
{% if type is not defined or type != 'hidden' %}
{% if not form.vars.uses_autocomplete %}
{% if form.vars.uses_autocomplete is defined and not form.vars.uses_autocomplete %}
{%- set attr = attr|merge({class: (attr.class|default('') ~ (type|default('') == 'file' ? ' custom-file-input' : ' o-input'))|trim}) -%}
{% endif %}
{% endif %}
Expand Down Expand Up @@ -199,15 +199,15 @@
{%- endblock radio_widget %}

{% block choice_widget_expanded -%}
{# <div {{ block('widget_container_attributes') }}> #}
<div {{ block('widget_container_attributes') }}>
{%- for child in form %}
{{- form_widget(child, {
parent_label_class: label_attr.class|default(''),
translation_domain: choice_translation_domain,
valid: valid,
}) -}}
{% endfor -%}
{# </div> #}
</div>
{%- endblock choice_widget_expanded %}

{# Labels #}
Expand Down Expand Up @@ -247,7 +247,7 @@
{{- label|trans(label_translation_parameters, translation_domain)|raw -}}
{%- endif -%}
{%- endif -%}
</{{ element|default('label') }}>
{% block form_label_errors %}{{- form_errors(form) -}}{% endblock form_label_errors %}</{{ element|default('label') }}>
{%- else -%}
{%- if errors|length > 0 -%}
<div id="{{ id }}_errors" class="mb-2">
Expand Down

0 comments on commit 2d00ece

Please sign in to comment.