I have made an order form where subforms are added when a button is pushed. Is there anyway to number the subforms as they are generated. The reason we would like to do this is to keep track of changes to particular line items within the order....
EX.
If i push button A....what i would like to see is...
1. [Asubform]
Views
Replies
Total Likes
Hi,
Here is an example: https://acrobat.com/#d=tIpEHFadQtSOefZkU9EBfQ
Check out the script in the subform index field.
Hope that helps,
Niall
You can to this by referencing the index of [Asubform], assuming that the textfield is inside [Asubform], like this:
Using Formcalc in the "layout:ready" event on a textfield with a caption:
$.caption.value.#text = Concat($.parent.index + 1, ". ")
Using Formcalc in the "layout:ready" event on a textfield with no caption:
$.rawValue = Concat($.parent.index +1, ". ")
Using Javascript in the "layout:ready" event on a textfield with a caption:
this.caption.value.resolveNode("#text").value = this.parent.index +1 + ". ";
Using Javascript in the "layout:ready" event on a textfield with no caption:
this.rawValue = this.parent.index +1 + ". ";
Thanks For the Code! But there is still an issue. I have many buttons that generate different subforms. Say for instance I push on "Button A" and subform 1. "A" appears. Then when I push on "Button B", subform 1. "B" appears. Is there to generate the following:
1. "A"
2. "B"
When I push button B it will recognize A and therefore put a 2 in front of subform B rather than a 1
Views
Replies
Total Likes
You need to create multiple instances of the SAME subform in order for the auto-numbering script to work. It looks like you may have buttons that point to different subforms.
Check your "click" events on all your buttons and make sure they point to the same repeated subform. Also make sure you check "Repeat Subform for Each Data Item" under the Binding tab of the subform you wish to repeat.
Views
Replies
Total Likes
Hi,
Here is an updated version: https://acrobat.com/#d=tIpEHFadQtSOefZkU9EBfQ
Note that each set of subforms sticks together as new ones are added. You can set up script to move an instance up or down within its set. However I don't think it is possible to shuffle subforms across the two sets.
Hope that helps,
Niall
Views
Replies
Total Likes
Can I email one of you my document? I can't seem to make it work....although both your answers are helpful. Thanks
Views
Replies
Total Likes
Sent a PM.
N.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies