Repeating content starting index = 1

davideiandoli75 03 Jul, 2017
I have got a field in which the user enters an integer number and I wish my repeater area displays the group of fields according to this.

Example: If I put "2" in number in first page I'll see 2 groups of fields in the second page. Is this possible? How?

Actually using {data:numero} shortcode I get always one group more than my needs, since the array starting index is 0.

Thanks a lot
Max_admin 03 Jul, 2017
Hi Davide,

You are using the correct syntax, and yes, if the provider is an integer then the repeater will create an array of elements between 0 and that integer, so you need to decrement that number before its used in the repeater's provider.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
davideiandoli75 03 Jul, 2017
Answer
Ok. I tried to do this by dragging a "Modify data" action in the second part of form, after "Multipage" and before "display section". I set "Data provider" as {data:numero], and then I tried to write in "Data override" this little snippet:

<?php
$this->data['numero'] = $this->data['numero'] - 1;
?>


and then I solved 🧐

Thanks a lot
This topic is locked and no more replies can be posted.