Creating a registration form for multiple participants

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.

How the form behaves

  1. When users open the form, they only see the fields for the first participant.
  2. Below these fields is a checkbox labelled Add another person. When users tick it, the fields for the next participant appear.
  3. This continues until a maximum of 20 participants have been added.
  4. Anyone registering on their own never sees more than one set of fields.

How it works

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:

  1. Ticking the checkbox in block 1 shows block 2.
  2. Ticking the checkbox in block 2 shows block 3.
  3. … and so on, up to block 20.

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.

Building the form

Start by creating all the form elements. You'll set up the conditions in the second step.

Creating block 1

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

Creating blocks 2 to 20 by duplicating

  1. Duplicate the 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.
  2. Change the label of the copy to Participant 2. The fieldset label is the only thing you need to change manually.
  3. Repeat these steps until you have 20 blocks. Each new copy is given the next number: person_2, person_3 and so on.
  4. In the Structure area, check the order of the blocks and drag and drop them into place if necessary.
  5. In block 20, delete the 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 –

Setting up the conditions

You need one condition for each block from block 2 onwards. Here's how to set up the condition for block 2:

Adding a condition

  1. In the Structure area, select the addperson multiple selection in block 1.
  2. Click the green Add icon.
  3. Go to General → Page elements and click Condition. The condition is inserted directly below addperson.
  4. Under Edit condition, give the condition a unique name – for example, Show person 2.

Setting the trigger under If

  1. In the Form element dropdown, select the addperson multiple selection.
  2. In the Operator dropdown, select Selected.
  3. Under Value, select the Add another person option.

Setting the action under Then

  1. In the Form element dropdown, select the person_1 fieldset – this is the block for participant 2.
  2. Under State, select Shown.

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.

Things to bear in mind

Mandatory fields in hidden blocks

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.

No conditions for the reverse case

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.

Removing participants

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.

Testing

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.

Summary

Your registration form is now ready to use:

  1. When the form is opened, only the block for the first participant is visible.
  2. Users can add further participants by ticking a checkbox, up to a maximum of 20.
  3. Mandatory fields only apply to the blocks that are actually shown.

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.

Feedback