User fribse wrote:
Having struggled through the repeater-area form, I wanted to post a few images on how it's done. I see a lot of explanation, but not a single image explaining it.
Remember to distinguish between square and curly brackets.
First of, insert a repeater area in you designer where you need it.
Some important info is here, first of the area reference, this is here area_repeater11, it will probably be another number for you, but keep the ID in mind.
Secondly, the Data provider tells CF where to store the entered data.
Lastly, if you want to be able to add more repeats, you should notice the 'Multiply button selector'
Then place the fields inside the repeater area
As this example is multilingual, the label contains the notation needed for that, but the important part is the Name.
The Name contains a variable called order, and inside that is a counter, shown as {var:area_repeater11.key}, as you can see the area_repeater11 refers to the name of the repeater area from above. Last is just the name of the field in this repeate: [antal]
Also note that I do NOT select 'include value in email' OR 'save to database'. These settings will only work for non-repeated fields.
Last part is to add the 'Add new' button, that is placed in the Footer of the Repeater area.
Here, the Class refers to the class set up in the repeater area.
That is all for the design part, you can of course have multiple fields inside the repeater area.
Then in the Actions after the Submit you need to enter a loop.
The Name here is the counter for the loop, and then all the repeated fields are added.
In this case, they are added with HTML tags for a table, and finally the result is returned as a variable named orderlines.
So to get all the entered fields sent to you in an email, you first add an email action after the loop.
As you can see, I start the body by building a table header, and then I place all the non-repeated fields in the email.
It is then continued like this
After all the 'non-repeated' fields I have placed the variable defined in the loop. And finally I end the table.
The result is a clearly understandable table placed in an email formatted in HTML, and most importantly, it WORKS!