Hi guys,
I got a task to build a Form with a subform. By clicking a button ("add" or "+") another subform of the same kind is created underneath and one button that removes the subform in wich it is placed (via removeInstance(this.parent.index)). That works pretty well. Now I am supposed to move the subform up and down with one button for each:
![mojo0220_0-1607591016143.png mojo0220_0-1607591016143.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/28697i2A26B1368BD66CB7/image-size/medium/is-moderation-mode/true?v=v2&px=400)
This too works. But the next task doesn't work. According to the position of the subform, the moving buttons are a) both there (for subform 2 to max-1), b) only move down (subform 1) and c) only move up (for subform max). After they are moved it should check again every subforms position and according to that position it shall hide a button (if it is moved to first or last position) or show them again (if moved from first or last position).
Here are some information on the names of subforms etc. and a first attempt by myself:
![mojo0220_1-1607591363327.png mojo0220_1-1607591363327.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/28698i05A551FFCDE94386/image-size/medium/is-moderation-mode/true?v=v2&px=400)
![mojo0220_2-1607591392723.png mojo0220_2-1607591392723.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/28699i13B0BB6ED2A28113/image-dimensions/704x215/is-moderation-mode/true?v=v2)
With this code the "move up" button of the first subform is hidden after opening the doc but after moving it down the "move up" button won't appear again.
I am quite clueless about what to do so maybe one of you can help me with that.
Thank you!