I am using javascript to change the color of field values based on a field's input from a lookup. When the form gets to the approval process the color doesn't carry through.
Javascript from starting form
$(document).ready(function () {
$('.MyTable').on('change','.stipDate input', function() {
if ($(this).val() != ''){
$(this).closest("tr").addClass("RedBackground");
$('.hours input').attr('readonly', true);
$('.hours span.cf-required').remove();
$('.hours input').removeClass('required').removeAttr('required');
//alert('Please remove Red lines');
}else{
$(this).closest("tr").removeClass("RedBackground");
$('.stipDate input').attr('readonly', true);
$('.hours label').append('<span class="cf-required">*</span>');
$('.hours input').attr('required', 'True');
}
});
});
Javascript from 2nd form used in approval process:
$(document).ready(function () {
$('MyTable').trigger('change', '.stipDate');
$('.MyTable').on('change','.stipDate input', function() {
if ($(this).val() != ''){
$(this).closest("tr").addClass("RedBackground");
$('.hours input').attr('readonly', true);
$('.hours span.cf-required').remove();
$('.hours input').removeClass('required').removeAttr('required');
}else{
$(this).closest("tr").removeClass("RedBackground");
$('.stipDate input').attr('readonly', true);
$('.hours label').append('<span class="cf-required">*</span>');
$('.hours input').attr('required', 'True');
}
});
});
what am I missing?