I am trying to set colors for table fields only based on their respective row.
$(document).ready(function () { $('.cf-table-block').on('change lookup', 'input', tablecheck); function tablecheck() { $('.cf-table-block tbody tr').each(function () { if($(this).find('.tbl_jobId input').val() !=' '){ $(this).find('.tbl_jobId input').css('background-color','#EFDFE0'); $(this).find('.breakDropdown1 select').css('background-color','#EFDFE0'); } }); } });
I was wondering if I was missing something to call on a per row basis versus it updating the entire table for that column.
I'm not sure how to iterate a for loop on a dynamic table and use the current iteration "i" to reference the field.