I’m trying to use this code to update the background of a field but nothing seems to happen. I’m obviously missing something but I have tried all the version I can think of. I just need this calculated field on the display form to be red if the value is greater than 6.
fd.spRendered(function() {
if (fd.field(‘Total_x0020_items’).value > 6){
fd.field(‘Total_x0020_items’).attr(‘style’,‘background:red’)
}
});
No luck. I'm not sure what I'm missing. It's almost like the Javascript isn't working at all. I tried to just set the color and that doesn't work. I'm just putting it in using the Javascript button in the ribbon.
@Margo I am having trouble but am basing the formatting on a Yes/No field
fd.spRendered(function() {
if (fd.field('America_x0027_s_x0020_PPO_x0020_10').value == true){
$(fd.field('America_x0027_s_x0020_PPO_x0020_10').$el).find('input').css('background-color','red');
}
});
Do I need something different?