• Resolved palko

    (@palko)


    Hello,

    is it possible to export a calculated value to the text of my website? The text and form are in one article.

    Thank for reply in advance

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

    (@codepeople)

    Hello @palko

    I’ll try to describe the process with a hypothetical example. Assuming there is a span tag or similar in the article: <span class="result-here"></span> and the equation in the calculated field is: fieldname1+fieldname2, you can edit the equation as follows:

    
    (function(){
    var result = fieldname1+fieldname2;
    jQuery('.result-here').html(result);
    return result;
    })()
    

    Best regards.

    Thread Starter palko

    (@palko)

    Hello,

    awesome!! It works great, many thanks!

    Best regard, Palo

    Thread Starter palko

    (@palko)

    Hello,

    i have one additional question:

    i want to add into article “result” and also 1/3 of the same “result”

    Thanks in advance

    Plugin Author codepeople

    (@codepeople)

    Hello @palko

    Continuing with the previous example, the code of the equation would be:

    
    (function(){
    var result = fieldname1+fieldname2;
    result *= 4/3; 
    jQuery('.result-here').html(result);
    return result;
    })()
    

    Best regards.

    Thread Starter palko

    (@palko)

    Hello,

    sorry for misunderstanding from my side.

    I need to have 2 results:
    first: result
    second: 1/3 of result

    And I need to use them separately:
    <span class=”result-here”></span>
    … text …
    <span class=”1/3 of result-here”></span>

    Thank you again

    Plugin Author codepeople

    (@codepeople)

    Hello @palko

    In this case, you can enter the information into the “HTML Content” field as follows:

    
    <span class="result-here"></span>
    … text …
    <span class="result2-here"></span>
    

    And now, you can edit the equation as follows:

    
    (function(){
    var result = fieldname1+fieldname2, result2 = result/3;
    jQuery('.result-here').html(result);
    jQuery('.result2-here').html(result2);
    return result;
    })()
    

    Best regards.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Export a calculated value to the text on my website’ is closed to new replies.