Can I Specify a number of entries?

Created on 19 March 2023, almost 2 years ago
Updated 27 March 2023, over 1 year ago

I'm pretty new to Webform, but I'm finding it to be a great tool. I'm currently working on a form, and having one of those, "Is there a better way?" moments.

On this form, I'm gathering family information. Part of this is asking for the name and birthdate of each child. Now, I realize that I CAN just say, "OK, for the audience I'm working with, nobody is likely to have more than 5 children" and just put 5 entries, "Child 1 Name" "Child 1 Birthdate", Child 2 Name", "Child 2 Birthdate", etc. but the thought crossed my mind, rather than either having several fields that are unneeded or on occasion, regardless of how many spaces are entered, not having enough of them. The idea came to me, considering that Webform has some intelligence behind it, is there a way where I could have a field that asks, "How many children do you have?" and allow them to enter a number, and then Webform/Drupal would use that number and subsequently ask for the Name, Birthdate, and whatever other information for that many children? (Recognizing as well, that as the end user, I may have 2 children when I initially complete the form, but then have another child, so we'd also need a way to add to that in the future...

As far as programming, etc. this seems like a simple "variable" issue, with a loop X number of times. As I say, I'm new to using Webform, so I'm not sure how I would go about inserting this "logic" into a form.

πŸ’¬ Support request
Status

Closed: outdated

Version

6.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States BEGRAFX Laconia, New Hampshire

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024