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
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
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.