Hello @jcollier
You have multiple alternatives to implement the described behavior.
I’ll try to describe the process with a hypothetical example.
Assuming you have three calculated fields, fieldname1, fieldname2, and fieldname3.
If fieldname1 has the largest value, you want to display the text:
Answer A. <a >Click Here</a>
If fieldname2 has the largest value, you want to display the text:
Answer B. <a >Click Here</a>
And the text below if the largest value is associated with the fieldname3:
Answer A. <a >Click Here</a>
First, insert an additional calculated field in the form to use as an auxiliary (I’ll assume it is the fieldname4). You can hide it by ticking a checkbox in its settings. And enter the equation:
(function(){
let value = fieldname1;
let result = 'Answer A. <a >Click Here</a>';
if(value < fieldname2) {
value = fieldname2;
text = 'Answer B. <a >Click Here</a>';
}
if(value < fieldname3) {
value = fieldname3;
text = 'Answer C. <a >Click Here</a>';
}
return text;
})()
Finally, insert an “HTML Content” field in the form where display the text, and enter a DIV tag as its content with the data-cff-field
attribute to tell the plugin the field whose value you want to display in the tag:
<div data-cff-field="fieldname4"></div>
Best regards.