I want to loop through a table and get the value of an input in a specific row. If that value is 0
disable all the inputs in that row.
Here's my latest unsuccessful attempt.
$('.hiderow-0 input[id*="Quantity"]').each(function() {
if($(this ).val() == 0){
$(this).closest('tr').find("input,button,textarea").attr('disabled',true);
}
});
Example HTML
<table>
<tr class='hiderow-0'><td><select name="data[TransactionItem][0][quantity]" id="TransactionItem0Quantity">
<option value="0" selected="selected">0</option>
<option value="1">1</option>
<option value="2" >2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select></td>
<td><input name="data[TransactionItem][0][note]" value="" maxlength="100" type="text" id="TransactionItem0Note"/></td>
<td><input type="checkbox" name="data[TransactionItem][0][waitlisted]" class="waitlisted" options="0 1" value="1" id="TransactionItem0Waitlisted"/>
</td></tr>
</table>