Hi,
You have 2 options:
1. Use jQuery to find the prev / next data from the DOM and generate the HTML on page load
or
2. Don’t use the has_sub_field while loop, instead use a more basic PHP foreach of for loop so you can use the ‘index’ to find the prev (index-1) and next (index+1) rows
Does that help?
Also, as this is the new support forum (currently in beta) I have a few questions for you if you don’t mind:
- Why did you not place your code within code tags as seen in the wysiwyg editor?
- Why did you not place the topic in the ‘General’ category when it would be better placed in ‘Repeater field’ or ‘Front end’?
- Why did you not enter any tags for the topic for users to search for in the future?
Thanks