Change background color and text of calculated Field

[ad_1]

Hello @tosh11formula

Yes, that’s possible.

For example, assuming the calculated field is the fieldname123, and you want to apply colors:

If the result is less than one, make the background color black and the text color yellow.

If the result is less than 30, make its background color yellow and text color black.

In this hypothetical example, the equation can be edited as follows:


(function () {
  var result = fieldname2 * fieldname6 * fieldname7 / 1000000,
    field = getField(fieldname123|n).jQueryRef().find('input');
		
    if (result < 1) {
        field.css({background: 'black', color: 'yellow'});
        return "Below 1 CBM kindly message us";
    }
    if (30 < result) {
        field.css({background: 'yellow', color: 'black'});
        return '30CBM Above, Kindly message us';
    }
    field.css({background: '#EEEEEE', color: 'black'});
    return PREC(result, 2);
})()

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer