• Resolved actuaryonfire

    (@actuaryonfire)


    Hi,

    How do I embed the results of a fieldname in a block of text? For example:

    “Your height is 165cm and your weight is 180lbs”

    The code might be something like this I guess…

    Your height is <%fieldname6%>cm and your weight is <%fieldname7%>lbs

    Thanks

    • This topic was modified 4 years, 2 months ago by actuaryonfire.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @actuaryonfire

    Please, follow the steps below:

    1. Insert an “HTML Content” field in the form, with a div tag as its content where would be displayed the text:

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

    2. Insert a calculated field in the form with the following piece of code as its equation:

    
    jQuery('#result-here').html('Your height is '+fieldname6+'cm and your weight is '+fieldname7+'lbs');
    

    3. Finally, since the calculated field is being used as auxiliary, you can hide by ticking a checkbox in its settings.

    Best regards.

    Thread Starter actuaryonfire

    (@actuaryonfire)

    Thanks – that works!

    How would I make the results embedded in the text bold?

    • This reply was modified 4 years, 2 months ago by actuaryonfire.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Text with fieldname results in’ is closed to new replies.