- Issue created by @BEGRAFX
- Status changed to Closed: outdated
over 1 year ago 6:45pm 27 March 2023
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.
Closed: outdated
6.2
Code