Environment:
- J!5.4.0
- CF:8.0.50
- PHP:8.3.27
I have a simple test form that has a repeater area that contains a dropdown field with a simple static list of options.
I find that if I create initial clone instances via a php action then the dropdown works as expected for those clones, but for any clone added within the form the dropdown does not work. There are no javascript errors in the console.
This issue occurs for clones created by javascript either from clicking an add clone button or setting "Start Count" >0 in the Repeater Area.
Hi Craig
For me the dropdowns work when I set the start count to 3 and when I add more on the form reaching a total of 5, please create a small demo form with the repeater and dropdown only and attach it here
Thanks for looking at this, I have a attached a simple form illustrating the issue. I think the issue comes from two aspects:
- The repeater key is "nnnn" not "n"
- There is PHP that initialises two clones
The form has a repeater area "start number" of 3 and a max of 20.
When the form is launched, I see 11 clones being created irrespective of the repeater key being "n" or "nnnn"
The change I suggested in the other topic https://www.chronoengine.com/forums/topics/view/111934/suggested-changes-to-cf8-repeater-area-with-initial-clones#p407525 resolves the number of clones created issue for my testing, but I only offer that as a suggestion.
Disabling the PHP action results in the correct number of clones being created, but the dropdowns do not work.
Disabling the PHP action AND changing the repeater from "nnnn" to "n" and all works ok.
Example form attached
So to confirm, if I apply the suggested fix I mentioned here to stop cloning of initial clones setup on a PHP action and change the repeater area key from "nnnn" to "n", all is working fine.
Hi Craig
Thanks for posting the fix, I have posted a new fix here:
Let me know if this one fixes the situation for you.
many thanks Max, yes your fix works well on my test cases. Note still need to use "n" rather than anything else, ie "m" or "nnnn" for the repeater key but I can live with that in the CF7 forms I am migrating.
I tested here using your form which has "nnnn" as the repeater key and it works fine!
What is not working for you when you change the key ?
Hi Max, So for the test form "TestRepeatDropDowns_18_Nov_2025_19_14_16.cf8bak" I uploaded to this topic has a repeater with a start count of 3 and a PHP action that puts some values into the first two clones.
In my tests, with or without your fix (or mine) for the number of clones created, I find that the dropdown in the 3rd clone does not dropdown. The same is true for any additional clones added via the add clone button. But, if I change the repeater key to "n" all dropdowns work as expected.
Hi Craig
Thanks for reporting this, I have fixed this issue and it should be available in the next update.
Hi Max, I did some more testing of the fixes and found what I think is another issue. Which can be demonstrated in the test form I uploaded to this topic "TestRepeatDropDowns_18_Nov_2025_19_14_16.cf8bak". The form has a repeater with a start number of 3. If you:
- launch the form, so it has three clones
- add three more clones
- remove the first three
- click submit, and the debugger shows clone data for clones 4,5,6
- click the go back button
- The start page shows 6 clones: 4,5,6,7,8,9
I would say it should only show 4,5,6
I can think of two suggestions for the above issue.
- You consider the "start count" as a minimum number that must exist and the remove clone button is hidden or disabled for those clones so that they are always there. (I have taken this approach as a workaround in some dom ready JS code) OR
- The clone init method that loops from 1 to "start count" first checks how many exist already and only adds more when needed.
The go back to start page issue above is fixed in CF 8.0.51, many thanks.
Hi Craig
Great, thanks for the confirmation, no problem :)
