$("table#flooring tr").find('td:eq('+checkbox+') input[type="checkbox"]').prop('disabled', true);
This is how I disable a checkbox based on the td it is in the variable checkbox
for index is dynamic depending on user input. How would it look if i change it to selecting all checkbox after the current one i tried
$("table#flooring tr").find('td:eq('+checkbox+') input[type="checkbox"]').nextAll().prop('disabled', true);
But it is not disabling the checkbox
Any idea is appreciated
UPDATE
<table id="flooring">
<tr>
<td><strong><p>Flooring</p></strong>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>
<hr/>
</td>
<td>
<span>1st Floor</span>
</td>
<td>
<span>2nd Floor</span>
</td>
<td>
<span>3rd Floor</span>
</td>
<td>
<span>4th Floor</span>
</td>
</tr>
<tr>
<td><span>Reinforced Concrete</span>
</td>
<td>
<input type="checkbox" class="floor1st checkboxfloor" name="flooring[]" />
</td>
<td>
<input type="checkbox" class="floor2nd checkboxfloor" name="flooring[]" />
</td>
<td>
<input type="checkbox" class="loor3rd checkboxfloor" name="flooring[]" />
</td>
<td>
<input type="checkbox" class="floor4th checkboxfloor" name="flooring[]" />
</td>
</tr>
<tr>
<td><span>Plain Cement</span>
</td>
<td>
<input type="checkbox" class="floor1st checkboxfloor" name="flooring[]" />
</td>
<td>
<input type="checkbox" class="floor2nd checkboxfloor" name="flooring[]" />
</td>
<td>
<input type="checkbox" class="floor3rd checkboxfloor" name="flooring[]" />
</td>
<td>
<input type="checkbox" class="floor4th checkboxfloor" name="flooring[]" />
</td>
</tr>
<tr>
<td><span>Marble</span>
</td>
<td>
<input type="checkbox" class="floor1st checkboxfloor" name="flooring[]" />
</td>
<td>
<input type="checkbox" class="floor2nd checkboxfloor" name="flooring[]" />
</td>
<td>
<input type="checkbox" class="floor3rd checkboxfloor" name="flooring[]" />
</td>
<td>
<input type="checkbox" class="floor4th checkboxfloor" name="flooring[]" />
</td>
</tr>
<tr>
<td><span>Wood</span>
</td>
<td>
<input type="checkbox" class="floor1st checkboxfloor" name="flooring[]" />
</td>
<td>
<input type="checkbox" class="floor2nd checkboxfloor" name="flooring[]" />
</td>
<td>
<input type="checkbox" class="floor3rd checkboxfloor" name="flooring[]" />
</td>
<td>
<input type="checkbox" class="floor4th checkboxfloor" name="flooring[]" />
</td>
</tr>
<tr>
<td><span>Tiles</span>
</td>
<td>
<input type="checkbox" class="floor1st checkboxfloor" name="flooring[]" />
</td>
<td>
<input type="checkbox" class="floor2nd checkboxfloor" name="flooring[]" />
</td>
<td>
<input type="checkbox" class="floor3rd checkboxfloor" name="flooring[]" />
</td>
<td>
<input type="checkbox" class="floor4th checkboxfloor" name="flooring[]" />
</td>
</tr>
</table>
Aucun commentaire:
Enregistrer un commentaire