Bind other input value properly and clear it when checkbox is toggled
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
inline-template
|
||||
{% if field.errors %}v-bind:initial-errors='{{ field.errors | list }}'{% endif %}
|
||||
{% if field.data and field.data != "None" %}v-bind:initial-value="{{ field.data }}"{% endif %}
|
||||
{% if other_input_field.data and other_input_field.data != "None" %}v-bind:initial-other-value="{{ other_input_field.data }}"{% endif %}
|
||||
{% if other_input_field.data and other_input_field.data != "None" %}initial-other-value="{{ other_input_field.data }}"{% endif %}
|
||||
key='{{ field.name }}'>
|
||||
<div
|
||||
v-bind:class="['usa-input', { 'usa-input--error': showError, 'usa-input--success': showValid }]">
|
||||
@@ -38,7 +38,7 @@
|
||||
<label for='{{ field.name }}-{{ field.choices.index(choice) }}'>{{ choice[1] }}</label>
|
||||
|
||||
<div v-show="otherChecked">
|
||||
<input type='text' name='{{ field.name}}_other' id='{{ field.name }}-other' value="{{ other_input_field.data }}" aria-expanded='false' />
|
||||
<input type='text' name='{{ field.name}}_other' id='{{ field.name }}-other' v-bind:value="otherText" aria-expanded='false' />
|
||||
</div>
|
||||
{% endif %}
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user