• Resolved jEbbS

    (@jebbs)


    Hi and I am using premium version of this plugin, purchased by a client on his website. I was wondering how can I create a loop of fields, calculated fields, to be precise, to repeat those fields until the user wants it to repeat. and than calculating the result of data feed in the loop on other calculated field?

    The page I need help with: [log in to see the link]

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

    (@codepeople)

    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!

    Plugin Author codepeople

    (@codepeople)

    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!

    Plugin Author codepeople

    (@codepeople)

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How do I create loop of calculated fileds-group?’ is closed to new replies.