Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Display different number of textfields depending on another value

More
10 years 4 months ago #115612 by srank
Hello,

I want to do the following:

In the first textfield the user should be able to enter the number of children he has.

Depending on that value, I want to show a different number of textfields where he can enter the names of his children.

For example, if he has 5 children, there should be 5 textfields for the names.

Is something like this possible with LimeSurvey?

Thank you.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 4 months ago #115616 by holch
This is possible.

First of all, I would not use a textfield for the first question, but a dropdown or radio button list with the number of children. I guess there won't be more than X children. This depends a little on your target audience, but in most countries the chance to get a respondend with more than 10 children should be small.

So I would go like 0,1,2,..., 10 or more.

Then you create 10 different text input question and use conditions or relevance equations to show each question. For example you would show text question 1 in case that he answers "1" in the first question. You would show TQ2 and TQ1 in case he/she answers "2", etc.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
More
10 years 4 months ago #115617 by srank
Thank you, I also thought about doing something like this. I thought there could be a simpler, cleaner solution.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 4 months ago #115618 by holch
Unfortunately there is no "looping" in Limesurvey. So you will need to do it this way. In your case it is not very problematic, because the max. number of children can be estimated quite well.

Can get worse if someone can have 50-100 employees and needs to fill in something like that...

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose