I have a simple code :
<div class="row" ng-repeat="aDiagnosis in diagnosisListForPrescription"> <div class="col-md-4 padding-right-zero" id={{aDiagnosis.rowIndex}}> <input class="form-control" name="aDiagnosisName" ng-model="aDiagnosis.Name" ng-disabled="true"> </div> <div class="col-md-4 padding-right-zero form-group" show-errors id={{aDiagnosis.rowIndex}}> <input class="form-control" name="aDiagnosisResult" ng-maxlength="200" ng-model="aDiagnosis.Result" /> <p class="help-block" ng-if="form.aDiagnosisResult.$error.maxlength">Too Large</p> </div> </div> and use $scope.form.$valid to generate the error message. But problem is since use ng-repeat every time it finds the same name and when i want to generate second list by clicking a button ,,first error message is gone and error-message now works on the second text (obviously). So How can i generate error-message each and every time dynamically ,,so every text form in ng-repeat,it has it's own error-message.