Last updated:
This article shows you how to use the Condition form element to create a registration form that lets users add more participants as they need them. The example is a seminar registration form for up to 20 participants.
The form contains all 20 blocks. Conditions make sure that users only see as many of them as they actually need.
This relies on one property of conditions: an element that is shown when a condition is met is automatically hidden while the condition isn't met. So there's no need to hide blocks 2 to 20 separately.
The conditions form a chain:
As the checkbox for the next participant always sits in the previous block, it only becomes visible once that block is shown. This means users can't skip a participant.
Start by creating all the form elements. You'll set up the conditions in the second step.
Each block consists of a Fieldset that groups together the fields for one participant. Set up block 1 in full, then create the remaining blocks by duplicating it.
Fieldset
| Setting | Value |
| Label | Participant 1 |
| Technical name | person |
Add the following elements to the fieldset:
| Form element | Label | Technical name | Mandatory field |
| Input field | First name | firstname |
yes |
| Input field | Last name | lastname |
yes |
| Input field | Email address | email |
yes |
| Multiple selection | – | addperson |
no |
Add exactly one option to the addperson multiple selection:
| Label | Value |
| Add another person | yes |
person fieldset. The copy is automatically given the technical name person_1, and the fields inside it are named firstname_1, lastname_1, email_1 and addperson_1.person_2, person_3 and so on.addperson_19 multiple selection. As there's no further block after this one, the number of participants is automatically limited to 20.Once you're done, your blocks will be named as follows:
| Block | Label | Fieldset | Fields | Checkbox for next person |
| 1 |
Participant 1 |
person |
firstname, lastname, email |
addperson |
| 2 |
Participant 2 |
person_1 |
firstname_1, lastname_1, email_1 |
addperson_1 |
| 3 |
Participant 3 |
person_2 |
firstname_2, lastname_2, email_2 |
addperson_2 |
| … |
… |
… |
… |
… |
| 19 |
Participant 19 |
person_18 |
firstname_18, lastname_18, email_18 |
addperson_18 |
| 20 |
Participant 20 |
person_19 |
firstname_19, lastname_19, email_19 |
– |
You need one condition for each block from block 2 onwards. Here's how to set up the condition for block 2:
addperson multiple selection in block 1.addperson.addperson multiple selection.Setting the action under Then
person_1 fieldset – this is the block for participant 2.That's your first condition done. As long as the checkbox in block 1 is empty, block 2 remains hidden. As soon as users tick it, block 2 appears.
Hidden mandatory fields aren't treated as mandatory. This means you can make first name, last name and email address mandatory in all 20 blocks. Users only need to fill in the fields in the blocks that are actually shown.
Don't create an additional condition to hide a block again. If the checkbox is unticked, the condition is no longer met and the block is hidden automatically. Additional conditions for the same state can overlap and cause the form to behave unexpectedly.
To remove a participant, users untick the checkbox in the previous block. If they want to remove several participants, they should work backwards, starting with the person they added last.
Once you've set everything up, test the following scenarios:
| Scenario | Expected behaviour |
| Open the form | Only block 1 is visible. |
| Tick the checkbox in block 1 | Block 2 appears. |
| Tick the checkbox in block 2 | Block 3 appears. |
| Keep adding people up to block 20 | Block 20 has no checkbox, so no further participants can be added. |
| Untick the checkbox in block 2 | Block 3 is hidden. |
| Fill in block 1 only and submit | The form is submitted, even though the mandatory fields in blocks 2 to 20 are empty. |
| Show block 2 but leave it empty | When submitting, the error messages for the mandatory fields in block 2 appear. |
You should also submit a test registration with several participants and check that all the details are included in full in the submitted form data.
Your registration form is now ready to use:
You can use the same approach for any form where information is repeated – for example, children on a holiday club registration, items on a complaint form or fellow travellers on a booking.
For more on the basics, see the articles Condition and Flag form elements as required fields.