Is there a way to highlight the contents of one (or more) fields based on the value of another field?
Using modifications to the solutions provided above, I am able to change the background of a field if the contents in that field equal a specific value, but how can I do this based on another field's value?
I've tried modifying it like this but it doesn't work, it changes the background on every cell in columns 2 and 3, not just the ones that have the 'DealerList' variable set to 'ABC':
if('[@field:DealerList]' == 'ABC')
{
document.addEventListener('DataPageReady', function(event)
{
const statusField= document.querySelectorAll('td:nth-child(2),td:nth-child(3)'); // '2, 3' are field numbers for which styles have to be applied
statusField.forEach(element =>
{
{element.style.cssText = 'background: #ff4600; font-weight: bold';}
});
});
}
This is what I would like it to look like:
But this is what I keep getting: