
I need to have a text field that if a user enters A the outcome will equal 0.485 and if they enter M it will equal 0.305.
So 3 Fields all together.
Field1 A=Auto or M=Motorcycle.
Field2 = Mileage
Field3 = Mileage dollar amount.
So something like Field1 = A,
Field2 = 12, Field3 = $5.82
field3 based on A=0.485 x 12
or if they enter M, M=0.305 x 12.
Export Value Will Not Work
I have 16 of the same fields.
My Product Information:
Acrobat Pro 8 / Windows
Offline

I'm assuming your using a LiveCycle form. If not then the technical details are different.
First, your better off using radio buttons to make the selection. Use JavaScript in the calculation script. So, for a radio button group named "RateSelect" the calculation code could look like this
// The first Radio Button is M // and the second Radio Button is A if(RateSelect.rawValue == 1) this.rawValue = Milage.rawValue * 0.305; else if(RateSelect.rawValue == 2) this.rawValue = Milage.rawValue * 0.485;
the export value of the radio buttons can be set in the Binding tab to anything, text or number. If you don't set them then a value of "0" means that none are selected, a value of "1" means that the first radio button is selected, a value of "2" means that the second radio button is selected, etc.
Offline

I am using Acrobat 8 Pro, I've tried radio buttons but getting errors when I reset the form.
So If I can I want to use Test Fields for A and M.
Will this script work in 8 Pro?
Offline

Oops sorry I meant Text Fields not Test Fields
Offline

Oops sorry I meant Text Fields not Test Fields
Offline

How can I do this in Acrobat 8 Pro?
Offline

The technique is the same no matter what forms technology or input field your using.
1. Acquire the value from the input field
2. Use it so select between two calculation options.
It seems you are getting hung up in the details. Here's a example using a text field for input on an AcroForm (Acrobat Form)
var cSelect = this.getField("InputField").value;
var nMilageVal = this.getField("Milage").value;
if(cSelect == "M")
event.value = nMilageVal * 0.305;
else if(cSelect == "A"))
event.value = nMilageVal * 0.485;
Offline

If I could kiss you I would :)
But we'll just keep this on the Down Low, you are a HUGE help.
Offline
AcrobatUsers.com >> User Groups • News • Events • Articles • Blogs • How To • Resources • Member Log in