I'm trying to build part of a simple form with Angular yet struggling with a small part of it.
Part of the form has a 'Divisions' section with a list of checkboxes that are dynamically populated from an API call. The user then can select anywhere from 1 to 7 different checkboxes to select which 'Division' the form belongs to.
Then when the user submits the form it should post JSON looking like Divisions: 'div1 div2 div3 div4'
The issue I'm having is for some reason I can't select more than one checkbox at a time. If I try and select another one, it unchecks the first one I selected.
This is the code I'm working with.
<label>Divisions Participating*</label>
<div class=radio-check-wrap>
<ul class=radio-check-group>
<li ng-repeat=d in divisions>
<input type=checkbox
ng-model=tradeshow.DivisionLead
ng-true-value=div{{$index}}
class= id=div{{$index}}
name=div{{$index}} />
<label for=div{{$index}}>{{d.Description}}</label>
</li>
</ul>
</div>
Also for clarification there is a $scope.divisions = Api.divisions.query();
and a $scope.tradeshow = {}
in the controller.
Any idea why I'm unable to select more than one checkbox at a time?