Among other things, make sure theres a name on the inputs so the forms can submit
This commit is contained in:
parent
034c147154
commit
c2851c2e86
@ -1,14 +1,18 @@
|
|||||||
{% from "components/icon.html" import Icon %}
|
{% from "components/icon.html" import Icon %}
|
||||||
|
|
||||||
{% macro TextInput(field, placeholder='', validation='anything', paragraph=False) -%}
|
{% macro TextInput(field, placeholder='', validation='anything', paragraph=False) -%}
|
||||||
<textinput name={{ field.name }} validation={{ validation }} inline-template {% if field.value %}value={{ field.value }}{% endif %}>
|
<textinput
|
||||||
|
name='{{ field.name }}'
|
||||||
|
validation='{{ validation }}'
|
||||||
|
{% if field.data %}set-value='{{ field.data }}'{% endif %}
|
||||||
|
inline-template>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class='usa-input {% if errors %}usa-input--error{% endif %}'
|
v-bind:class="['usa-input usa-input--validation--' + validation, { 'usa-input--error': showError, 'usa-input--success': showValid }]"
|
||||||
v-bind:class="['usa-input usa-input--validation--' + validation, { 'usa-input--error': showError, 'usa-input--success': showValid }]">
|
class='usa-input {% if field.errors %}usa-input--error{% endif %}'>
|
||||||
|
|
||||||
<label for={{field.name}}>
|
<label for={{field.name}}>
|
||||||
{{ field.label }}
|
{{ field.label }}
|
||||||
|
|
||||||
{% if field.description %}
|
{% if field.description %}
|
||||||
<span class='usa-input__help'>{{ field.description | safe }}</span>
|
<span class='usa-input__help'>{{ field.description | safe }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -27,8 +31,9 @@
|
|||||||
<textarea
|
<textarea
|
||||||
v-on:input='onInput'
|
v-on:input='onInput'
|
||||||
v-on:change='onChange'
|
v-on:change='onChange'
|
||||||
v-model='renderedValue'
|
v-bind:value='value'
|
||||||
id='{{ field.name }}'
|
id='{{ field.name }}'
|
||||||
|
name='{{ field.name }}'
|
||||||
ref='input'
|
ref='input'
|
||||||
placeholder='{{ placeholder }}'>
|
placeholder='{{ placeholder }}'>
|
||||||
</textarea>
|
</textarea>
|
||||||
@ -38,15 +43,16 @@
|
|||||||
<masked-input
|
<masked-input
|
||||||
v-on:input='onInput'
|
v-on:input='onInput'
|
||||||
v-on:change='onChange'
|
v-on:change='onChange'
|
||||||
v-model='renderedValue'
|
v-bind:value='value'
|
||||||
|
v-bind:mask='mask'
|
||||||
|
v-bind:pipe='pipe'
|
||||||
|
v-bind:keep-char-positions='keepCharPositions'
|
||||||
id='{{ field.name }}'
|
id='{{ field.name }}'
|
||||||
|
name='{{ field.name }}'
|
||||||
type='text'
|
type='text'
|
||||||
ref='input'
|
ref='input'
|
||||||
placeholder='{{ placeholder }}'
|
placeholder='{{ placeholder }}'
|
||||||
:guide="true"
|
{% if field.errors %}aria-invalid='true'{% endif %}>
|
||||||
:mask="mask"
|
|
||||||
:pipe="pipe"
|
|
||||||
:keep-char-positions="keepCharPositions">
|
|
||||||
</masked-input>
|
</masked-input>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user