I need to find the net value of three text boxes. I have the following Java Script but it isn't working. Any ideas what I am doing wrong?
var a = this.getField("Void Amount").value; // variable for the estimated value
var b = this.getField("Parts Total").value; // variable for the actual value
var c = this.getField("Labor Total").value; // variable for the actual value
this.getField("Net Void").value =(b+c)-a; // variable for the actual value
Ex: I need to find the "Net Void" amount total - Say the Void Amount is $500 from that I need to subtract the sum of "Parts Total" $125 and "Labor Total" $100. The Net Void would be $275 but I can not get the java script to calculate this.
These values are all right next to each other on the form ie: Void Amount, Parts Total, Labor Total, Net Void
Any help will be GREATLY APPRECIATED.
Thanks and have a good day!
LKN
Read this article at JavaScript Corner on calculation scripting-
http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/form_calculations/
In that article it explains that you need to assign a value to the event.value variable, which is missing in your script.
Also, when scripts are not working you should use the Console Window to see what errors if any are reported. If you don't know how to use the Console Window you can read all about that at-
http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/javascript_console/
Hope this helps,
Dimitri
www.pdfscripting.com
www.windjack.com
Dimitri Munkirs
WindJack Solutions
pdfscripting.com