Notum
June 28, 2024, 12:10pm
1
We have a form repeat and within this form repeat there is a radio button repeat.
All works fine with 1 item in form itself, but when there are several items - $index is not working for radio buttons is not working, because it takes $index not from form repeat, but from he's repeat.
I found few topic but there was no answers:
I have a form repeat with a nested form repeat and am having trouble getting the name/index to format correctly, which then makes the data from the child repeat insert into the db as an array based on each index of each child repeat instead of each as their own value on a separate row.
I have scoured every portion of the forums here and the documentation for this and in trying what I have seen to be the most commonly suggested solution for this it is not working as expected, so it is making me …
Hello!
I have a nested repeat, that generates structured input fields as shown in a structure below. Every sub-repeat element generates index from 0, and I can’t figure out how to define “general” index for all repeat elements so I can use it as reference in multi-insert later.
The elements form structure like this (analogy for easier description would be Heading 1 and Heading 2 levels: H1.H2 )
1.1 $index=0 - but I need: 0 (= “general” index)
1.2 $index=1 - but I need: 1
1.3 $index=2 - but …
@Teodor or @patrick may we ask you to help us?
In nested repeats I usually use a variable to hold the outer repeat and then refer to (nested) inner repeat with $index
Example
Repeat
variable repeatIndx = $index
-- Nested repeat
---- dmx-value="query[repeatIndx.value].subquery[$index].aValue"
Something like that.. If I understood correctly what you're looking for my friend
2 Likes
Notum
June 28, 2024, 12:26pm
3
You are totally right.
Almost forgot about this tricky hack.
Thank you!
2 Likes