Hello,
I have no coding skills and I am trying to build a dynamic form using LiveCycle and the internet (along with another colleague). We are building the dynamic form as a series of tables, where the rows are questions. The questions are structured to have yes / no answers, and when an answer is no, we want the user to be able to input a comment.
Currently, we can do this by brute force by building the table with the question as one row, the comment as a row under it. The comment row is hidden on initiation and shown when No is selected. It looks like this:
![1658808_pastedImage_0.png 1658808_pastedImage_0.png](/t5/image/serverpage/image-id/15288iBD81F7C7F1AEB6AC/image-size/large?v=v2&px=999)
We would like to code this a little different to make it easier to revise, ect. I have been able insert a row "between" rows using code I found off this site:
var currentRepeatable = this.parent;
var im = currentRepeatable.instanceManager;
var newRepeatable = im.addInstance(1);
im.moveInstance(newRepeatable.index,this.parent.index +1);
However, this only inserts the row that the pull down box is on. I don't want to insert the same row. I want to insert the "Comment" row. So I did figure out how to insert a fragment. I made the comment row a fragment, and hid it. I can get it insert, but only at the bottom of the table. I am using code that looks like this (called when the drop down list is No):
_Comment.addInstance(1).presence= "visible";
Before:
After:![1658809_pastedImage_3.png 1658809_pastedImage_3.png](/t5/image/serverpage/image-id/15289i524E8F694501F770/image-size/large?v=v2&px=999)
![1658858_pastedImage_4.png 1658858_pastedImage_4.png](/t5/image/serverpage/image-id/15290i1061D57E6BB7F473/image-size/large?v=v2&px=999)
Is there a way to insert the fragment "between" rows? I have been trying moveInstance with no success.
Thanks in advance,
Shawn