PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/ __________________________________________________________________
There are a few things to look at.
The most likely reason for a problem is when you have various calculations, and there are dependencies. If there are dependencies, the Calculation Order is crucial. You will have to make sure that the sequence of the calculations is correct, which means that a result used in another calculation gets calculated _before_ that other calculation gets executed.
You can fix this by adjusting the Calculation Order (which you will find in the Forms submenu item).
Also, I am always a bit sceptical when simple calculations and JavaScript is mixed (it may be my prejudices against the pre-cooked calculations (aka simple calculations)), but it is definitely better to do everything in JavaScript.
And, back to the dependencies. The more automatic calculations you have, the more sluggish the form will work. The cure for this is to consolidate all calculations of chained calculations into one single script, which you then assign to the Calculate event of the very last result in the chain. This will help you a lot to keep the dependencies under control.
Hope, this can help.
Max Wyss PRODOK Engineering Low Paper workflows, Smart documents, PDF forms CH-8906 Bonstetten, Switzerland
Fax: +41 1 700 20 37 or +1 815 425 6566 e-mail: mailto:[EMAIL PROTECTED] http://www.prodok.com
[ Building Bridges for Information ]
______________________
I am having a problem with a script I wrote to do a subtraction calculation for a company form.� This for is a statement of account used for showing a customer a breakdown of charges and credits�which has resulted�in an owed balance.� All of the charges are in one column and all of the credits are in the subsequent column.� I inserted a hidden total field for each column. (i.e. total charges and total credits)� These two total fields add up all the fields in the appropriate column and calculate correctly everytime.� The next step involved a simple (or so I thought) script for the total balance owed.� (A simple calculation I have used before,�with no problem, of sutracting the total credits from the total charges.)� For some reason this last calculation does not work.� Each time�the result�in this field is merely the last entry�in a column, whether it be a credit or a charge.� I don't really under! stand why this is not working because, like I said, I have used�the same script before with no problem. Here is the script that is used:
�
var a=this.getField ("totalcharges");
var b=this.getField(totalcredits");
event.value=a.value-b.value;
�
The total fields for each column use the "Value is the (Sum+) the following fields" which is set up in the field properties box.� These calculations work perfectly everytime new information is entered.
�
Some more information you might need is that I am using Adobe 6.0 and I also have a script which changes the field color to gray upon tabbing into it.� This script works on both "On Focus" and "On Blur".� Any suggestions or alternatives�you may have will help me greatly as this form is ready to go as soon as I fix this problem.
To change your subscription: http://www.pdfzone.com/discussions/lists-pdfforms.html
