I m trying to check all the checkboxes on the basis of their values but it only checked the first row. I don't know how to assign a value to the same id elements
HTML code:
<tbody class="col-lg-12 col-md-12" style="height: 400px; width: 400px; overflow: auto;">
@foreach (var item in Model.DetailList)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.FormCode, new { @id = "formCode" }) - @Html.DisplayFor(modelItem => item.FormName)
</td>
<td style="text-align:center;">
<input type="checkbox" id="view1" name="view" />
</td>
<td style="text-align:center;">
<input type="checkbox" id="add1" name="add" />
</td>
<td style="text-align:center;">
<input type="checkbox" id="edit1" name="edit" />
</td>
<td style="text-align:center;">
<input type="checkbox" id="delete1" name="delete1" />
</td>
<td style="text-align:center;">
<input type="checkbox" id="post1" name="post" />
</td>
<td style="text-align:center;">
<input type="checkbox" id="print1" name="print" />
</td>
</tr>
}
</tbody>