Custom form with dynamic fields

Question:
Hello there!

I hope you can help me here. I’m relatively new to web design and am trying to create a registration form for a homepage that provides information about a running event and stores the data in the CMS.

Everything works fine with static text input. However, what I’m struggling with is that the user can specify a table, list, or something similar where a different number of runners will be registered.

Structure of the form:

There should be a team with a “team leader”, “team name”, “address information” “e-mail” and “telephone number”.

Now comes the part that causes difficulties:
There should a list of runners per team (number from 1-30, different between teams), and data must be collected for each runner.

Does anyone have an idea how I can achieve this? I tried to do this with repeaters, but without success.

The form should therefore be “dynamic” per team and kinda look like this:

The Data should be stored in CMS collection. I tried it with a simple text input, but then the data is not structured and i need to verify that phone, mail, address per runner is given.

Thanks in advance for the help!

Product:
Wix Editor

The fields will not dynamically appear. You have to create the static fields, hide them, then show the appropriate row of fields based on the quantity answered previously.

You would also have to enable required or not required via coding.

All of it has to be coded.