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

If/Then statements needed for this drop down box calculation?

Sam Taylor
Registered: Oct 27 2011
Posts: 1

Hello everyone, first time poster here and very little knowledge (if any) with JavaScript.
 
We have built a form for use that is designed to calculate various items and provide a monetary total based on inputs.
 
For one section of the form, a user is asked to tell us how many "outlets" there are between 0 and 5. The charge from 1 to 5 outlets is only $5 TOTAL.
 
The problem we're having is that we cannot get the form TOTAL field to output correctly to $5.00.
 
We can set it up so that the total field always says $5.00, but that doesn't work, because if there are not outlets, there is no charge.
 
Basically, what I'm trying to figure out is if we can use Acrobat's internal functions to set this form up in a way so that, if a user selects "0" outlets, the charge is $0.00 but if they select 1 through 5 outlets, the Total is $5.00.
 
Or is this something in which we need to code JavaScript? If so, I would love suggestions or some coding help.
 
We're using Adobe 9.4.6
 
Thank you very much!

My Product Information:
Acrobat Standard, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Let's say the name of the outlets field is "outlets". Then use this code as the custom calculation script of your total charge field:

  1. if (getField("outlets").value=="0")
  2. event.value = 0;
  3. else event.value = 5;

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com