i have a normal text field and a Add Field button in my form. If someone enters information in the text field, how do i make it such that when they click the Add Field button, a new field is added (but with default the same information that was entered earlier), and they can choose to overwrite the information on the subsequent repeated filed?
Presuming that your subform and text field are called sfInfo and tfInfo, respectively, here's my solution to this problem:
xfa.resolveNode("sfInfo["+ (sfInfo.instanceManager.count-1) +"].tfInfo").rawValue = xfa.resolveNode("sfInfo["+ (sfInfo.instanceManager.count-2) +"].tfInfo").rawValue;
It should be in the click event for your button. Remember, you'll need to change the object names in the script to match what you've got in your form. Also, that first line "btnAdd::click" was just to let you know what event it should be in.
thanks for your advise, i am still testing out the above.
However i have some new questions on repeating subforms, i believe you are an expert in this field and i wonder if i reach you through your personal email address? I would like to send a form to ask you for some advise if you dont mind!