45 lines
1.3 KiB
HTML
45 lines
1.3 KiB
HTML
{% if include.form %}
|
|
{%- assign name = include.field[0] | append: ']' | prepend: '[' | prepend: include.form -%}
|
|
{%- assign id = include.field[1].id | default: name | replace: '[', '_' | remove: ']' -%}
|
|
{% else %}
|
|
{%- assign name = include.field[0] -%}
|
|
{%- assign id = include.field[1].id | default: name %}
|
|
{% endif %}
|
|
|
|
{%- assign label = include.field[1].label[site.locale] -%}
|
|
{%- assign help = include.field[1].help[site.locale] -%}
|
|
{%- assign error = include.field[1].error[site.locale] -%}
|
|
{%- assign autocomplete = include.field[1].autocomplete -%}
|
|
|
|
<div class="form-group" data-controller="postal-code" data-postal-code-group="{{ include.field[1].group }}">
|
|
<label for="{{ id }}">
|
|
{{ label }}
|
|
{% if include.field[1].required %}*{% endif %}
|
|
</label>
|
|
|
|
<input
|
|
name="{{ name }}"
|
|
id="{{ id }}"
|
|
data-target="postal-code.code"
|
|
{% if help %}
|
|
aria-describedby="help-{{ id }}"
|
|
{% endif %}
|
|
{% if include.field[1].required %}
|
|
required
|
|
{% endif %}
|
|
type="{{ include.field[1].type }}"
|
|
{% if autocomplete %}
|
|
autocomplete="{{ autocomplete }}"
|
|
{% endif %}
|
|
class="form-control" />
|
|
|
|
{%- if error -%}
|
|
<div class="invalid-feedback">{{ error }}</div>
|
|
{%- endif -%}
|
|
|
|
{%- if help -%}
|
|
<small id="help-{{ id }}" class="form-text">
|
|
{{ help }}
|
|
</small>
|
|
{%- endif -%}
|
|
</div>
|