I have just about pulled out all my hair at this point. I have tried and tried, but this just seems to be beyond me. I have read many examples of Javascripting so far today and I just don't seem to be able to do this one simple thing. I use the built-in sum/multiply functions in Acrobat 8 Pro, which work well and I tried the Simplified Field Notation for subtracting, but it won't run, so I thought I would wade into to Javascript. Well, maybe not.
I have copied in several examples below - my fields are named "total claims needing to be paid" and "total plan payments" which I substituted instead of "Text1" and "Text2".
if (event) { // get values from two text fields
var a = Number(this.getField('Text1').value);
var b = Number(this.getField('Text2').value);
// subtract the values and show it
this.event.target.value = a - b;
and
var a=this.getField ("total claims needing to be paid");
var b=this.getField ("total plan payments");
even.value=a.value-b.value;
Neither of these works for my situation and I don't yet know enough to build my own script, but I'm working on it. The problem is I need this to work as soon as possible. I just finished a big, long acrobat form that has been a long time in the making. This is the last thing I need to do.
I tried the Field Notation that Dimitri provided of Text1-Text2, which didn't work either.
Could this be a problem because the "a" and the "b" fields are both calculated fields (+) themselves. I want to subtract "b" from "a". Could it be a field calculation ordering problem?
Any advice would be appreciated. thanks.
Diane
It could very well be the field calculation order is incorrect. Have you confirmed it's OK?
George