• Resolved mevabien22

    (@mevabien22)


    Hello, suppose a user entered this data in a form:

    fieldname1 = 3
    fieldname2 = 5

    I want to show in the “Field Label” of a “Field Type: Calculated Field”

    the following text:

    The sum of [fieldname1] + [fieldname2] is:

    Where instead of fieldname1 and fieldname2 appear the values that user entered, in this case:

    The sum of 3 + 5 is:

    Is this possible?

    Thank you.

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

    (@codepeople)

    Hello @mevabien22

    Yes, of course, you can implemente the code you want. For example, assuming the current equation is:

    fieldname1+fieldname2

    First, assign a custom class name to the calculated field, for example: my-field

    Note: the class names are assigned to the fields through their attributes: “Add CSS Layout Keywords”

    and then, edit the equation associated to the calculated field as follows:

    
    (function(){
    var label = "The sum of fieldname1+fieldname2 is", 
    result = fieldname1+fieldname2;
    
    jQuery('.my-field label').html(label);
    
    return result;
    })()
    

    and that’s all.
    Best regards.

    Thread Starter mevabien22

    (@mevabien22)

    Thank you very much for the quick response, it works without problems!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘The sum of [fieldname1] + [fieldname2] is…’ is closed to new replies.