I have a table with checkboxes and textboxes. The checkboxes are disabled on pageload. Their ids are assigned using a for:each loop in my jsp. I want to enable the checkbox once their textbox on their corresponding row changes value. Here's my code:
for (var i = 0; i < listSize; i++) {
$("#doctorName" + i).on('change', function(){
$("#rowCheck" + i).prop('disabled', false);
});
}
If I replace $("#rowCheck" + i) with $("#rowCheck0"),
it enables the checkbox. I don't want to hardcode every checkbox id since i render an undetermined number of rows.