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

Need help with Calculation

KoloheBoy
Registered: Feb 2 2009
Posts: 3
Answered

Hi,

I have created a form for Mileage and have a problem.

I have it set to where Mileage = Odometer Start - Odometer End = Mileage

But If no Odometer reading is take, but just the Mileage then he/she can enter a value into Mileage
and I can have the Amount Line Total.

Here is what I got for now

var f = this.getField("Odo End Line 1");
var g = this.getField("Odo Start Line 1");
var h = this.getField("Mileage Line 1");
event.value = f.value - g.value;
ifelse(event.value = h.value)

But, it's not coming up if I put a value in the Mileage box.

Your help is great.

My Product Information:
Acrobat Pro 6.0, Windows
KoloheBoy
Registered: Feb 2 2009
Posts: 3
That's ok.. I got help already..
Here is the solution

from DPS on another forum

//
var start=this.getField("Odo End Line 1").value;
var end=this.getField("Odo Start Line 1").value;
if ( start=="" || end=="") event.rc=false;
else event.value=Math.abs(end-start);
//