I submitted this topic last week but it seesm to have disappeared from the site! I'll try again...
I have created a dynamic table that I named "Vehicle". It has one body row. In the body row, I created a subform with multiple text fields in it. Users will be entering information about their vehicles and I want to number their vehicles as they add more to the form. (There is an "Add Vehicle" button below the table.)
Here is my Hierachy:
Vehicle [Table]
Row1 [Body Row]
VehicleSubform [Subform]
VehicleNo [Text Field]
[Plus several other text fields within this subform]
AddVehicle [Button]
"VehicleNo" is the text field that should populate with a sequential number based on the number of instances of the subform. So for example, the field would populate with "1" if the user hasn't clicked on the "AddVehicle" button at all. Once they click "AddVehicle" for the first time, another instance of the subform will appear and I want the "VehicleNo" field on that subform to read "2". And so on.
The "AddVehicle" button is working perfectly; I just can't get the number of instances to appear in the "VehicleNo" text field.
I put _VehicleSubform.count in the calculate script for the "VehicleNo" text field. But that still shows "1" for each additional instance of the subform. I tried adding ++ at the end of the script but that didn't make any difference.
I am a scripting newbie, so I'm not sure which command(s) I need to make this happen. Any help would be greatly appreciated!
this.rawValue = this.parent.index + 1;
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script