lundi 9 novembre 2020

Enable all checkboxes with one checkbox click

I have a table where I have a column name and near the column name I have a checkbox. That particular column name values inside the table by default are check boxes. What I need is that when I enable the checkbox near the column name, all the checkboxes in the table under that column should be enabled and when I disable the checkbox in column name all checkboxes in table under the column should also be disabled?

<div class="Container"  >

<div class="table-responsive">
<table class="table">
<thead class="table_header">
<tr>
<th>ID</th>
<th>Name</th>
<th>Category</th>
<th>Old date</th>
<th>New date</th>


<th> <input type="checkbox" id="vehicle1" name="vehicle1" value="Bike"> Status</th>



</tr>
</thead>
<tbody>
<tr *ngFor="let form of formlist; index as i">
<td></td>
<td></td>
<td></td>
<td></td>

<td> <input type="checkbox" id="vehicle1" name="vehicle1" value="Bike"></td>


</tr>
    </tbody>
    </table>
</div>
</div>

What I need is that when I enable the checkbox near the column name status, all the checkboxes in the table under that column should be enabled and when I disable the checkbox in column name all checkboxes in table under the column should also be disabled?




Aucun commentaire:

Enregistrer un commentaire