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

Custom Javascript Code for Acrobat 9 Form • Volume Discounts

skipnosis
Registered: Oct 24 2011
Posts: 2
Answered

Hello,
 
I'm an acrobat newbie working on an order form that needs some Javascript programming.
 
http://bootiebabe.com/order_form_npc01.pdf
 
I have the basic calculations set up on the form but want to offer a volume discount:
 
1,200 - 4,800 bottles: 10% discount
4,801 - 9,600 bottles: 15% discount
9,601 -12,000 bottles: 20% discount
12,000+ bottles: 25% discount
 
so it's just a matter of seeing what's the total quantity field and determining the discount percentage then calculating the Grand Total.
 
In the discount field I want to just show the percentage (10-25%), not the discount in currency...
 
It would also be nice not to have the fields automatically placing "$0" in all the fields (someone may want to print out the form and fill it out with a pen).
 
Any help would be most appreciated.
 

Mark

My Product Information:
Acrobat Pro 9.4.3, Macintosh
Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
Accepted Answer
Hi,

The main script is in the "Grand total" field, with a validation line in the "Total quantity" field and all the sub-total fields for not displaying zero.
Also see "date", "email" and "country" fields…

==> http://abracadabrapdf.net/parking/AcroUsers/order_form_npc01_OK.pdf

;-)
skipnosis
Registered: Oct 24 2011
Posts: 2
Thank you so much Jean-Renaud! That was incredibly nice of you - I would have never figured that out on my own!

oh i had a bit of trouble when i tried to enter a quantity of "4801" or "9601" into a field - got an error message "the value entered does not match the format of the field [ GRAND TOTAL ]

or if I put "3600" into one field and "1201" into another (which adds up to "4801") i also get the same error message

any ideas?

thanks.

Mark

Mark

Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
skipnosis wrote:
any ideas?
Oops !
I made a silly mistake in the JavaScript.
It's OK now, you can re-download it : http://abracadabrapdf.net/parking/AcroUsers/order_form_npc01_OK.pdf

;-)