Hello @jebbs,
I’m sorry, I don’t understand your question. Could you be more precise, please? or maybe describe a specific case?
Best regards.
Thread Starter
jEbbS
(@jebbs)
For example, to calculate average of marks of n number of subjects, user will write down subject name in field A1 and marks in field B1. Then the user can click on more button to have the same fields as A2 and B2. After adding 5 subjects and marks for them, he can click on ‘submit and get average’ button to add B1 + .. + A5 and divide it by 5 with arithmetic equation and print the result.
I hope I explained it properly!
Hello @jebbs,
I’ll try to explain the process with an example, assuming there are five number fields (or checkboxes fields): fieldname1, fieldname2, fieldname3, fieldname4, and fieldname5 (you can hide/show them using dependencies: https://cff.dwbooster.com/documentation#dependencies), a possible equation would be:
(function(){
var counter = 0;
if(fieldname1) counter++;
if(fieldname2) counter++;
if(fieldname3) counter++;
if(fieldname4) counter++;
if(fieldname5) counter++;
if(counter) return (fieldname1+fieldname2+fieldname3+fieldname4+fieldname5)/counter;
return 0;
})()
Best regards.
Thread Starter
jEbbS
(@jebbs)
That’s a great way out..!! Thank so much for your quick responses… I will get back to this once I try this out!
Hello @jebbs,
If you need additional help I can offer you a custom coding service from my private website:
https://cff.dwbooster.com/customization
Best regards.