Repeating Subform

Avatar

Avatar

raykohbard

Avatar

raykohbard

raykohbard

17-06-2015

Hi Everyone,

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?

Many thanks.

Ray

Accepted Solutions (0)

Answers (4)

Answers (4)

Avatar

Avatar

raykohbard

Avatar

raykohbard

raykohbard

26-06-2015

Hi jasotastic81

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!

Ray

Avatar

Avatar

jasotastic81

Avatar

jasotastic81

jasotastic81

23-06-2015

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.

Avatar

Avatar

raykohbard

Avatar

raykohbard

raykohbard

23-06-2015

Hi jasotastic81,

thanks a lot for your reply. Sorry i am not good with programming skills, which part should i add this script?

Thanks!

Avatar

Avatar

jasotastic81

Avatar

jasotastic81

jasotastic81

19-06-2015

Presuming that your subform and text field are called sfInfo and tfInfo, respectively, here's my solution to this problem:


btnAdd::click


sfInfo.instanceManager.addInstance();


xfa.resolveNode("sfInfo["+ (sfInfo.instanceManager.count-1) +"].tfInfo").rawValue = xfa.resolveNode("sfInfo["+ (sfInfo.instanceManager.count-2) +"].tfInfo").rawValue;