Good day all.
I have a form that changes the row color based on values entered. If either value entered is larger than the other value entered, the row color changes. The problem is that the color does not show in the next approval step. it only shows when the user submits the form. The color also does not appear on the form when it is saved to the repository.
here is the code :
$(document).ready(function() { setTimeout(function(){ $('body').addClass('loaded'); }, 3000); $('.cf-table-block').on('blur', 'input', highlight); function highlight(){ $('.cf-table-block tbody tr').each(function(){ var t1 = 0; var t2 = 0; t1 = parseNumber($(this).find('.requested input').val()); t2 = parseNumber($(this).find('.allowed input').val()); if (t1 > t2) { $(this).closest('tr').css("background", "LightGrey"); } else if (t2 < t1){ $(this).closest('tr').css("background", "LightGrey"); } else if (t1 == t2) { $(this).closest('tr').css("background", "none"); } }); } function parseNumber(n){ var f = parseFloat(n); return isNaN(f) ? 0 : f; } });
Any help will be greatly appreciated.