What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
Is it possible to count variable number of participants to use in calculations?Asked by GuyPalinckx on January 17, 2017 at 05:39 AM
I used the widget and I was wondering if I could use calculated field.
As the number of entries is variable, it should need to calculated each entry
e.g. if there are 3 entries, it should multiple 3 entries with 5 € ==> 15€
This is the amount that need to be payed before they can participate but the number of entries can be different
Is this possible?
I couldn't understand your query perfectly. I understand that you have variable number of participants and you want to calculate the cost with respect to participant number.
The easiest way to do this is to use Infinite List widget:
In this widget, the user can insert new lines according to their needs. There is an option that counts row number. You can use this count in your calculations:
Or another solution is to have a separate field that user can enter the total participant number. Then you can use this number directly in your calculation.
I prepared a sample form for you to investigate the issue further. Please feel free to clone this form and investigate. The form is: https://form.jotform.com/70162891859972
Here is a guide in cloning: https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL
I hope this answer helps. Please don't hesitate to contact us for your further queries.
All the best!
Thanks for your reply.
I'll try to explain more.
My form (https://form.jotformeu.com/70161946638361) will indicate how many runners will join. (see second page)
they can add as many runners as they want but for each runner, they need to pay 5 €.
I should calculated the total amount (number of runners + 5€)
With the other tool, I can't add the options I already have in my form.
Hope this explain it more
I'm afraid there's no way to get Calculation Values from the Configurable List widget.
You only have 2 workarounds to choose from:
1. EITHER create the fields as is, using plain form fields (e.g. Textboxes and Dropdown menus) then perform calculation normally.
2. OR use another widget that will allow you to count the number of entries (or rows) added. The Infinite List Widget does just that.
Related guide: How-to-Add-a-Widget-to-your-Form
Thanks for your answer.
Only in the other widget, I can't use dropdown list ... to avoid that people type what they want.
So I'm a bit stuck here :(
no other solution via CSS or so?
Unfortunately, CSS code can not help with that since CSS is used to change the style of the form.
I am afraid that what my colleague Jim suggested are the only options.
All fields in the form are represented as one field, for example, Configurable list, it contains multiple fields, but it is actually one field for the form. Therefore, you can not use fields from the Configurable list in calculations.
If you have any additional questions please let us know.