Skip to content

Commit

Permalink
fix: target field validation errors on clearing (#655)
Browse files Browse the repository at this point in the history
- fixes issue #626 where clearing a target field lists multiple errors

Co-authored-by: Allan Mogusu <allanmogusu@Appless-MacBook-Pro.local>
Co-authored-by: Isaac Kimaiyo <40719885+Kimaiyo077@users.noreply.github.com>
Co-authored-by: Andrew <andrew.tc.pham@gmail.com>
  • Loading branch information
4 people authored Jul 11, 2020
1 parent a3102b4 commit 4e9ff6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions templates/indicators/forms/target_period_modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
<div v-show="showTable" class="col-md-12" id="id_targets">
<table id="targetsTable" class="table table-hover">
<tbody>
<tr v-for="target in targets" :key="target.id">
<tr v-for="(target, index) in targets" :key="target.id">
<th>[[target.period]]<br><small>[[target.start_date]] - [[target.end_date]]</small></th>
<td>
<input
Expand All @@ -179,9 +179,9 @@
type="number"
:id="target.id"
v-model= "target_value[target.pk]"
name="target value"
:name="'target value ' + (index + 1)"
v-validate="'required'"/>
<span v-show="errors.has('target value')" class="help is-danger">[[ errors.first('target value') ]]</span>
<span v-show="errors.has(`target value ${index + 1}`)" class="help is-danger">[[ errors.first(`target value ${index + 1}`)]]</span>
</td>
</tr>
<tr>
Expand Down

0 comments on commit 4e9ff6a

Please sign in to comment.