Hi,
Yes of course, I’ll try to explain a possible implementation through an example. I’ll assume that your form includes two number fields: fieldname1 and fieldname2, and you want to display the text: “Excellent result: xyz” if fieldname1+fieldname2 is bigger than 100, “Good result: xyz” if fieldname1+fieldname2 is bigger than or equal to 50, and “Bad result: xyz” in other cases.
First, I’ll insert a “HTML Content” field in the form, and enter as its content the div tag below, where will be displayed the text:
<div id="result"></div>
and then the equation associated to the calculated field would be as follows:
(function(){
var sum = fieldname1+fieldname2;
var text = '';
if( sum > 100 ) text = 'Excellent result: '+sum;
else if( sum >= 50 ) text = 'Good result: '+sum;
else text = 'bad result: '+sum;
jQuery('#result').html( text );
})()
Please, uses a similar logic in your project.
If you don’t want to display the calculated field in the form, you simply should untick the checkbox: “Hide Field From Public Page” in the field’s attributes.
Best regards.
Thanks for your quick reply.
It works!
Best regards,
Koen