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

Custom Calculation Script

djfixxx
Registered: Mar 22 2007
Posts: 111

Custom Calculation Script
I have a PDF converted from Excel using this Simple Calculation =B12+B14+B15+B17+(B18*0.485)+B19
 
When I use the same calculation in Javascript it causes $3.00 to become $30.00
event.value = this.getField("M
My format is correct and if I remove *0.485 calculation it works right.
 
Please don't tell me you can't use addition WITH multiplication. That would almost render Acrobat useless for fom calcs.
 
The form is here to check
[link=http://www.rockndj.com/TravelAuthorization.pdf]http://www.rockndj.com/TravelAuthorization.pdf[/link]

It professional, networking, technical, graphical, imaging, froms.

My Product Information:
Acrobat Pro 8, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi dj,

I'm sorry but your calculation got cut off so we can't see where the problem may be. Also you do not say if you are trying to do this in Acrobat or LiveCycle Designer. And, the link to your PDF is not working so no luck there either.

I'm not sure if writing the code again will help because there is a persistant problem with code getting cut off here- hopefully a fix is in the works, but you could try again to provide a working link to your PDF.

What you want to do is possible- you can have addition and mulitplication in your script- hard to say what the problem is though, due to the above issues.

Dimitri
WindJack Solutions
[url=http://www.windjack.com]www.windjack.com[/url]
djfixxx
Registered: Mar 22 2007
Posts: 111
try this link

[url=http://www.rockndj.com/TravelAuthorization.pdf]http://www.rockndj.com/TravelAuthorization.pdf[/url]

It professional, networking, technical, graphical, imaging, froms.

djfixxx
Registered: Mar 22 2007
Posts: 111
Ok I checked it works now.
So on Day 1 calculating DOWN starting at M&IE Per Diem + Lodging + transportaiton + Rental Car + Personal Auto Miles (this is the tricky one) + Other* = Total Expenses

It professional, networking, technical, graphical, imaging, froms.

Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi dj,

I checked Column 1 and the only problem I saw was the Total column format was set to "Special" so it was throwing an exception "The value entered does not match the format of the field "TotalExpenses.1"
I changed it to "number" format and it all worked for me. The miles entered in "Personal Auto miles" are the actual miles, but the amount in the total field adds it as a multiple of 0.485.
You should avoid using characters like "&" in naming fields, and using the dot notation for fields can also cause problems (.1, .2 etc).I did not see the original error you wrote about ( 3 becomes a 30) here on my system.

Hope that helps,

Dimitri
WindJack Solutions
[url=http://www.windjack.com]www.windjack.com[/url]
djfixxx
Registered: Mar 22 2007
Posts: 111
Thanks I'll check it again.

It professional, networking, technical, graphical, imaging, froms.