• Resolved Radovan

    (@radovand)


    Hi,
    I am having trouble displaying the HTML code through a field of type “Calculated Field”.

    Example:
    fieldname1 (type Calculated Field) contains the HTML code:

    <h4>Main Features</h4>
    <ul>
    <li>Includes a form builder for adding/editing different field types, including one or more automatically calculated fields based on data entered in other fields.</li>
    <li>The submitted information can be sent by email to one or more email addresses and an auto-reply to the user who filled the form.</li>
    <li>The form can be prefilled from external data-sources</li>
    <li>It is possible to connect the form to a PayPal payment, either for one-time payments or for recurrent/subscription payments.</li>
    </ul>

    fieldname2 (type Calculated Field) contains the function:


    (function(){
    return fieldname1;
    })()

    Instead of displaying the contents of fieldname1 (HTML code), the value “3” is displayed.

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

    (@codepeople)

    Hello @radovand

    Thank you very much for using our plugin.

    The plugin preprocesses the fields’ values in the equations to use with mathematical operations. However, the plugin includes modifiers.

    What are the modifiers? The modifiers are symbols you add to the fields’ names in the equations to tell the plugin how to handle the fields’ values and modify the default plugin behavior.

    A modifier is |r. The |r tells the plugin you want to use the field’s raw value instead of the preprocessed one.

    So, the second equation could be:

    (function(){
    return fieldname1|r;
    })()

    Other modifiers are |n, and |v. They are not necessary in your current project but I will describe them in case you need these modifiers in the future.

    The plugin replaces the fields’ names with their values before evaluating the equations. The |n modifier tells the plugin you are referring to directly to the field’s name instead of its value.

    Eg.

    (function(){
    getField(fieldname123|n).setVal(fieldname1|r);
    return fieldname1|r;
    })()

    The |v modifier only applies to radio buttons, checkboxes, and dropdown fields. These controls contain choices, and each choice has a text and value. The plugin uses the values of the user-selected choices from the equations. The |v modifier allows you to access the value of the information these fields will submit.

    For example, if you have the radio buttons field fieldname123, and you configured it to submit the choice text, and you use fieldname123 in the equation. You would be using the value of the choice ticked by the user. But if you use the |v modifier, fieldname123|v you would use, in this case, the choice text.

    Best regards.

    Thread Starter Radovan

    (@radovand)

    It works.
    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Calculated field does not display HTML code’ is closed to new replies.