For some reason I am unable to get the form element when it has a [] in the name. for example when I try the following
<input class="form-control col-md-1" type="text" name="first_name" id="user_signup_last_name" placeholder="First name" ng-model="user.first_name" required >
<span style="color:red" ng-show="myForm.last.$dirty && myForm.first_name.$invalid">
<span class="col-md-1" ng-show="myForm.first_name.$error.required">First name required.</span>
But when I try changing the name to have [] the validation stops working.
<input class="form-control col-md-1" type="text" name="user[first_name]" id="first_name" placeholder="First name" ng-model="user.first_name" required>
<span style="color:red" ng-show="myForm.user[first_name].$dirty && myForm.user[first_name].$invalid">
<span class="col-md-1" ng-show="myForm.user[first_name].$error.required">First name required.</span>
- How do we do get angular to validate on the name attribute with [] ?
- is there a way we can use id instead of name to check the validation?