These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Shipping price based on shipping date

KDCS
Registered: Sep 30 2009
Posts: 36
Answered

I am looking for a way to tie a date selected on a drop down date field to a shipping price.

Example: If I purchase widget A and select a ship date 10 days from the current date, a shipping price will show up in numbers field. And if a ship date 30 days from the current date is selected, a different price will show in the numbers field.

Can someone tell me if this can be done or if there is a script I can use to get this done?

My Product Information:
LiveCycle Designer, Windows
suewhitehead
Registered: Jun 3 2008
Posts: 232
Search the Learning center's livecycle articles for Thom Parker's "Programming List and combo boxes" article. With it you can learn how to make the entry in one field change the entry in the second field.
KDCS
Registered: Sep 30 2009
Posts: 36
Thank you Sue. I appreciate the information and with it I have found another way to complete my project.
hattg
Registered: Jun 18 2009
Posts: 36
Hello,

I have used this example and have modified it for my lists, but what I need is for it to populate a second price field as well named Price2. I have two prices for items based on quantity, and I need to populate 2 price fields with different values.

Any help will be greatly appreciated. I am new to javascript, so please bear with me through this.

Thanks
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The parts order form example is in two parts, i.e., two lists. A selection on the first list populates items on the second list. A selection from the second list then populates a form field with a price value acquired from the export value of the selected list item. If you want to populate two price files from the list selection you have two options.

1. Option one is to place both values in the list item export as a comma separated string, then parse out the values when the selection is made. This is a small modification to the existing logic. Here's an article that shows how strings can be easily parsed into separate values:
http://www.acrobatusers.com/tutorials/2006/string_splitting

2. Or, use an external array of data to store the price values. This is exactly the same strategy used by the first list. It uses a JavaScript Object to map a list selection to a new set of items for the second list. It's an small stretch to use this same strategy to map a list selection to two price values.

Cheers,
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]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script