Expand my Community achievements bar.

Reset Repeating Subforms

Avatar

Former Community Member
Hi,

I'm creating a form which is much like an purchase order sheet. The user can add new items by clicking on a [+] which inserts a repeated subform.



[+] Item Quantity Price



[-] Some item 1 $1000

[-] Some item2 1 $1000



TOTAL $2000



What I am trying to do is when the user hits the reset button, I want to reset the number of repeated subforms to 1 and clear all the data. I can clear the data but I can't remove the subforms. Basically, it will remove the data but have those 2 subforms left behind.



[+] Item Quantity Price



[-]

[-]



TOTAL $0.00



Any help will be much appreciated.
3 Replies

Avatar

Former Community Member
I had the same question and found this worked on click. My subform names are item and item2



xfa.host.resetData();

xfa.resolveNode("item").instanceManager.setInstances(1);

xfa.resolveNode("item2").instanceManager.setInstances(1);

Avatar

Former Community Member
Thanks sonjam! It works for the most part. Except that I receive the following error: accessor 'detailHeader.RadioButtonList.rawValue' is unknown.

The script ascoiated with this error is:

if(detailHeader.RadioButtonList.rawValue == 1) then

detail.total1*0.07

elseif(detailHeader.RadioButtonList.rawValue == 2) then

detail.total1*0.08

endif

Avatar

Former Community Member
The error is telling you that the RadioButtonList does not exist.



Make sure you have a RadioButtonList or make sure your RadioButtonList has a value before you try to manipulate the rawValue.



Hope that helps.

Stone.