Expand my Community achievements bar.

How to copy table row data to next row in a repeating form

Avatar

Former Community Member
I have search long and far for a solution to this and I hope someone can help me here. I can't believe someone hasn't done what I would like to do.



I have a repeating subform. It adds and deletes rows just fine. In fact I "borrowed" the Adobe purchasing order template and used it as a basis for my template. Thank you Adobe :)



I would like to copy certain cells of the first row in the table and once a second row is created paste those copied cells into the coordinating cells of the second row. Same thing for a third row except copy the cells from the previous row (2nd row) and paste to the third row, so on and so on.



The idea behind this is to save the user from typing in the same info from row to row. The info won't always be the same, that's why I can't use a Global variable.



I'm not exactly sure where my script should go. I first inserted it under the click event of my "Add a new row" button. Then I saw an example of adding a copy/paste example under the individual cell's exit event.



Then I began to wonder do I need an array to determine the row I am in.

Whatever I've have done, the error I keep getting is:

xfa.resolveNode("form1.#subform[0].details.detail.lglIdentity[1]") has no properties



If anyone has any advice or an example to help me, I would really appreciate it. Thank you in advance.
2 Replies

Avatar

Former Community Member
try this: (add the script to the same button that adds rows.. but after it)



var f = MYSUBFORM.all.length;



xfa.resolveNode("MYSUBFORM[" + (f) + "]").FIELD.rawValue = xfa.resolveNode("MYSUBFORM[" + (f-1) + "]").FIELD.rawValue;

Avatar

Former Community Member
Chris T.



Thank you so much Chris for taking the time to give me this. It worked perfectly. I really appreciate your help!