• Resolved rachelflara

    (@rachelflara)


    Hello,

    I want the total value to be less than or equal to 100. If true, show the value of the sum if it does not give an invalid warning. How to make?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello,

    Assuming your current equation is for example: fieldname1+fieldname2, you can edit it as follows:

    (function(){
    var r = fieldname1+fieldname2;
    return IF(r<=100,r,'The warning message here');
    })()

    and that’s all.
    Best regards.

    Thread Starter rachelflara

    (@rachelflara)

    Thanks. This function worked perfectly.
    If I want to put the error warning in red color how do I?

    Plugin Author codepeople

    (@codepeople)

    Hello,

    Assuming your calculated field is the fieldname3, the equation can be edited as follows:

    (function(){
      var r = fieldname1+fieldname2;
      if(r<=100){
        jQuery('[id*="fieldname'+'3_"]').css('color','black');
        return r;
      }else{
        jQuery('[id*="fieldname'+'3_"]').css('color','red');
        return 'The warning message here';
      }
    })()

    If you need additional help implementing your equations, we can offer you a custom coding service from our private website:

    https://cff.dwbooster.com/customization

    Best regards.

    Thread Starter rachelflara

    (@rachelflara)

    Thanks!! Now, it’s perfect.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Total Calculation with maximum value’ is closed to new replies.