I am working on jquery code for a table in Forms that looks at each row to make sure a number (amount requested ) is not greater than another number (budgeted amount- this field is populated by a lookup and could be different on every row.) If the amount requested is over budget I hide the submit button and the ability to create new rows. The code works great on the initial row and any additional rows added, but the problem occurs whenever I go back to a prior row and make a change- the code (although it triggers) does not seem to be working with the line selected. Any help would be much appreciated! THANKS in advance!!!
$(document).ready(function(){ $('.table').on('change onloadlookupfinished', check); }); function check(){ $('.table tbody tr').each(function(){ if (1*$(this).find('.requestedamount input').val() > 1*$(this).find('.budgetamount input').val()){ $(".action-btn.Submit").hide(); $(".cf-table-add-row").hide(); } else { $(".action-btn.Submit").show(); $(".cf-table-add-row").show(); } }); };