Hi!  I hope everyone had a safe and enjoyable New Year!
 
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.
 
Thanks in advance,
 
Amy


Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003

Reply via email to