Hello,
I am designing a travel form that details a
travel itinerary for our clients. Our clients do
not always have typical itineraries so I'd like our
form to be flexible enough to acommodate any
combination of legs in a trip.
I've created each travel category in its own subform (flight, car, hotel, etc.).
I’ve created a button for each instance to repeat with
the following script assigned to the “Click” event for each button.
_hotel.insertInstance(1);
_flight.insertInstance(1);
_car.insertInstance(1);
Currenty, each new instance appears grouped
with the same category of instance.
Example:
Flight
Flight
Flight
Rental Car
Rental Car
Rental Car
I'd like to be able to create any order of instances
Example:
Flight
Rental Car
Flight
Rental Car
Hotel
Is there a way to do this?
Thanks.
A better way to do it would be to place all of your repeated subforms into a single parent subform.
The repeat this parent subform instead of repeating the individual entries (flight, rental, and hotel). Make all of the contained subforms "hidden", and only make one of them visible when a new instance is added.
You'd have buttons like "new Flight" "New Rental", that create the new parent and set the presence for the correct subform.
Hope this helps,
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script