Forums

ChronoForms Repeater Start Number at 1

newbandon 23 Mar, 2020
Is it possible to get Repeater Areas to start numbering at 1 instead of 0?

As an example, a field Label says "Person -N- Name" which turns into "Person 0 Name," "Person 1 Name," and so on when the Repeater is activated. This works great to add and remove people via a text field, but the numbering always starts at 0 which is confusing to end users. There have been other forum posts on this, but no resolution I can find. Does anyone have any ideas to get the Repeater to start at a real number?

The Repeater Area is one of the most amazing, incredible and simultaneously mind-boggling, frustrating features in ChronoForms is . So much power and so many tears.
GreyHead 24 Mar, 2020
Hi newbandon,

There is a setting in the Repeater Area - 'Key Providers (Optional) "Optional list of valid keys to limit the repetitions, or use an integer to clip items with keys values lower than this integer."

Bob
newbandon 24 Mar, 2020
My form has a Repeater Area and a multiplier with the Max Multiplies set to 6. I have tried the following values in the Keys Provider field with no effect:
0
1
1,2,3,4,5,6
7
Can you please provide an example of what should be in the Keys Provider field when the multiplies is 6 and the numbering needs to start at 1?
GreyHead 25 Mar, 2020
Hi newbandon,

Doesn't work for me either :-( I suggest that you use the Contact menu above to ask Max, the developer, and link to this thread.

Bob
rotocal 17 Apr, 2020
Good afternoon guys hope everyone is OK..... I am in agreement with newbandon .... it would be great if start with 1 and not with cero.
I have a similar question in regard with repeater . My Repeater is a requisition line with following fields/buttons .... Ln, Item, Description, Button(for search descrip), Qty., price , VAT ...and button for line removal. When I hit the button for description search (green one), it will be call a function from the button event tab (Javascript) which opens a popup window. I need to pass to this function the element id of the button pressed (which for the first row in this case is : Model0button8_button8). My interest is the Cero (0) between the Model and the word "button" . The reason is: I need to bring back some information from the search (popup) window to the parent window. Imagine please you are editing a requisition with 10 lines and you want to change the description of line 5. So you press the green (search) button of the fifth (5) row, ..... and expect that the information coming back from the child window comes back to the right row (5) in the parent window. I know I could pass the button id to the function something like this ...Myfunction(this.id) <button ...... onclick=Myfunction(this.id)...... />, however I need to use the CF repeater with its numbered ids (Model0button, Model1button, Model2button)..... Any idea?

rotocal 17 Apr, 2020
Passing current row of repeater with button : ...I got it .... the only thing remaining that I would like is .... start with 1 and not with cero ....

Solution found for passing the current row to popup window: Button click event calls the function SelectItem() without paramenters

<script type="text/javascript">

var popup;
var cur_row = 0;

function SelectItem() {
var str = document.activeElement.id; // Button id
var largo = str.length;
var aleer = largo - 23; // Reason : button id = DataLnXbutton56_button56 (has a lenght of 24) - X is the current row .... 0, 10, 100?
var cur_row = str.substr(6, aleer);
// alert ('Current row : ' + cur_row);
var urlPass = "/search-item?row=" + cur_row; // Passing the current row with the url with GET
popup = window.open(urlPass, "Popup", "width=500, height=500");
popup.focus();
}

</script>
Max_admin 18 Apr, 2020
I will try to have this feature added to v7 soon
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rotocal 20 Apr, 2020
Yes that would be great ... or at least that the field default Value for a "repeater Line Id" (in my case Ln above ).... you could put something like ... {var:area_repeaterN.key} + 1
Thank you
newbandon 23 Apr, 2020
Looks like the thread got hijacked. I still haven't gotten a response on if the numbers can start at number 1. I even messaged Max like GreyHead suggested. Anyone have any ideas to make this work?
Max_admin 23 Apr, 2020
Answer
Hi, in v6 it's not easy to fix this, but Repeaters should start at 1 in v7, the beta is available for download, link is on our Blog:
http://www.chronoengine.com/blog

However, this is still a beta release and there may be some changes before the official release, so you may need to redo part of the work.

For Repeater Area inv7 you will need to use #area_repeater_NUMBER.index# to be replaced by the current entry number!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
amheng5 01 Sep, 2021
I got it to work to show 1 as the first (guest)entry;




however my dilemma is when I add Guest 2 and Guest 3 and then decide to delete Guest 3, but then decide to add an entry the next shows Guest 4 instead of Guest 3 which I removed earlier. Any idea of how to continue the numbering the active add from the last active # versus the last delete?

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