So I have a table inside of my view and I have gotten to the point where my select-all checkbox is selecting/unselecting. However I can't seem to get it to select all the checkboxes. It only selects the first checkbox in the list.
Here is a snippet from my view.
<table class="table table-bordered">
<tr>
<th>@Html.CheckBox("CheckAll", false, new { id = "select_all" })</th>
@for (int i = 0; i < Model.additionalCustomerInfoListView.Count; i++)
{
<tr>
<td>@Html.CheckBoxFor(model => model.additionalCustomerInfoListView[i].IsSelected, new { id = "someDivId" })</td>
and here is my jQuery
$('#select_all').click(function () {
var c = this.checked;
$('#someDivId').prop('checked', c)
});
Appreciate any help I can get!