I am currently working on a form using Angular and facing a challenge with a specific section.
Within the form, there is a 'Divisions' segment that includes a list of checkboxes generated dynamically from an API call. Users are required to select 1 to 7 checkboxes to identify the 'Division' the form is associated with.
Upon form submission, the JSON should display as Divisions: 'div1 div2 div3 div4'
The issue I am encountering is the inability to select multiple checkboxes simultaneously. Whenever I attempt to select another checkbox, the previously selected one gets unchecked.
Below is the code snippet I am currently utilizing.
<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>
Additionally, in the controller, there is
$scope.divisions = Api.divisions.query();
and $scope.tradeshow = {}
.
Can anyone provide insight as to why I am facing this limitation with checkbox selection?