mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 13:39:41 -04:00
adding required html field
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
{#- a record of other elements that we need to associate with the input using
|
||||
aria-describedby – for example hints or error messages -#}
|
||||
{% set describedBy = params.describedBy if params.describedBy else "" %}
|
||||
<div class="usa-form-group {%- if params.errorMessage %} usa-form-group--error{% endif %} {%- if params.formGroup.classes %} {{ params.formGroup.classes }}{% endif %}" aria-live="polite" role="alert">
|
||||
<div class="usa-form-group {%- if params.errorMessage %} usa-form-group--error{% endif %} {%- if params.formGroup.classes %} {{ params.formGroup.classes }}{% endif %}">
|
||||
{{ usaLabel({
|
||||
html: params.label.html,
|
||||
text: params.label.text,
|
||||
@@ -42,5 +42,7 @@
|
||||
{%- if describedBy %} aria-describedby="{{ describedBy }}"{% endif %}
|
||||
{%- if params.autocomplete %} autocomplete="{{ params.autocomplete}}"{% endif %}
|
||||
{%- if params.pattern %} pattern="{{ params.pattern }}"{% endif %}
|
||||
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
|
||||
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}
|
||||
{%- if params.required %} required{% endif %}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
data-{{ key }}="{{ val }}"
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
novalidate
|
||||
>
|
||||
{{ caller() }}
|
||||
</form>
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
safe_error_message=False,
|
||||
rows=8,
|
||||
extra_form_group_classes='',
|
||||
placeholder=''
|
||||
placeholder='',
|
||||
required=None
|
||||
) %}
|
||||
<div
|
||||
class="usa-form-group{% if field.errors %} usa-form-group--error{% endif %} {{ extra_form_group_classes }}"
|
||||
@@ -56,6 +57,7 @@
|
||||
rows=rows|string,
|
||||
placeholder=placeholder,
|
||||
aria_describedby=field.name+"-error",
|
||||
required='required' if required else None,
|
||||
**kwargs
|
||||
) }}
|
||||
{% if suffix %}
|
||||
|
||||
Reference in New Issue
Block a user