Reputation: 1910
I have inputs with dynamically assigned names. As a result I have input names like
name="Athlete/Guardian_firstName"
For inputs it's fine, but validation doesn't work since this record
medForm.Athlete/Guardian_firstName.$invalid
is invalid for angular's ng-class due to the slash "/". (medForm is form's name). Are there any other way to access inputs from form in angular, so inputs with any special characters will work?
<div class="form-group" ng-class="{ 'has-error': medForm.Athlete/Guardian_firstName.$invalid }">
<label for="firstName" class="col-md-3 control-label">First Name</label>
<div class="col-md-9">
<input type="text" class="form-control" id="firstName" name="Athlete/Guardian_firstName" required ng-model="firstName">
</div>
</div>
Upvotes: 1
Views: 1001