Buy Now
Sign in

FAQ search

Illustrated guide to the CFv6 Repeater area

Details
Published: Wednesday, 24 April 2019 08:57

Please note that as of Chronoforms 6.1.1 update, setting the email auto template setting to "Include Page templates", a full page template is going to be added to the email including the repeater data in a nice format, for this to work correctly you will need to use the new "Model" setting in the repeater area.

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.

repeater_area.png

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

repeated_field.png

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.

multiple-button.png

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.

loopevent.png

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.

email1.png

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

email2.png

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!