valdr icon indicating copy to clipboard operation
valdr copied to clipboard

valdrMessage not working correctly with multiple inputs for same model field

Open AdrianM opened this issue 9 years ago • 1 comments

The given example iterate over some zone objects with the required field "code". Valdr validates each field and adds ng-valid/ng-invalid correctly. But valdrMessage show the error message only if the second field is invalid (and in this situation for both input fields).

<form name="validationErrorForm" ng-controller="ValidationForm as validationForm" novalidate>
  <div class="input-wrap" ng-repeat="zone in validationForm.codes">
    <div valdr-type="NewZoneTo" valdr-form-group>
      <label class="control-label">Code</label>
      <input type="text" placeholder="Code" ng-model="zone.code" name="code" class="form-control">
    </div>
  </div>
</form>

ValdrMessage resolves the field by name and not by id which could be the origin of the problem. Is there a solution for this?

AdrianM avatar Nov 03 '15 11:11 AdrianM

+1, any update on this?

ldoblies avatar Aug 13 '18 10:08 ldoblies