Support » Plugin: Calculated Fields Form » Text Color in Return Statement

  • Resolved digiblogger

    (@digiblogger)


    If I Output text as part of the return Statement, along with a variable, for example:

    return “Hello Mr. ” + fieldname22

    How can I set the text Color for a) the part between “…” and b) the fieldname value

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

    (@codepeople)

    Hello @digiblogger

    You cannot, because the equation’s result is displayed into an input tag.

    The alternative would be to use the calculated field as auxiliary, but display the result into a “HTML Content” field.

    For example, insert a “HTML Content” field in the form, and enter as its content the a DIV tag similar to the following one:

    
    <div class="result-here"></div>
    

    and then, as part of the equation you can use the piece of code:

    
    var result = '<span style="color:red;">Hello Mr.</span> <span style="color:blue;">'+fieldname22+'</span>';
    jQuery('.result-here').html(result);
    return result;
    

    Note that the previous code is not the equation as a whole, it is a piece of code that is part of the equation.

    Finally, you can tick the checkbox in the settings of the calculated field for hiding it from the public form, because it is being used as auxiliary.

    Best regards.

    Thread Starter digiblogger

    (@digiblogger)

    I will definetly give it a try.
    Thank you again

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Text Color in Return Statement’ is closed to new replies.