I am facing an issue with the code below that generates 3 text boxes. When I click on one text box, all 3 of them get focused, despite having different name and label values.
<div class="col-md-12" data-ng-repeat="dohPolicy in [1,2,3]">
<div class="col-md-2" style="padding:0px; margin-right:1%;">
<p style="font-size:11px;">P no {{dohPolicy}} </p>
</div>
<div class="form-group col-md-6"
data-ng-class='{ "has-focus": dohForm.dohPolicy.hasFocus,
"has-success": dohForm.dohPolicy.$valid,
"has-error": dohForm.dohPolicy.$invalid && (dohForm.$submitted || dohForm.dohPolicy.$touched),
"is-empty": !dohForm.dohPolicy.$viewValue }'
style="right: 150px; bottom: 40px; padding: 0; width:20%;">
<label for="dohPolicy"></label>
<input type="text" name="dohPolicy"
data-ng-model="dohPolicy" required readonly
data-ng-blur='dohForm.dohPolicy.hasFocus=false'
data-ng-focus='dohForm.dohPolicy.hasFocus=true'>
<p data-ng-show="dohForm.dohPolicy.$error.required && (dohForm.dohPolicy.$touched || submitted)"
class="error-block">
P Number(s)
</p>
</div>
</div>
Even after trying to use string arrays, I haven't been able to resolve this issue. I would like only the clicked text box to be focused and highlighted.
Any assistance is welcomed!
Thank you