I have a 'Subtotal' field that calculates OK and then a field where the user enters a value for, 'I already paid ($).'
There are 2 Total fields.
So, the Total1 field should be 'Subtotal' minus 'Advance'
The tricky part, is if the user already paid MORE than the Subtotal, Total2 field should calculate 'We owe you' and make Total1 show zero.
I'm new to LiveCycle, but this is the script that has been done in Acrobat:
Total1
var SubTotal=this.getField("SubTotal");
var Advance=this.getField("Advance");
var n=0;
//Check for a negative value
if (SubTotal.value - Advance.value > 0)
{event.value = (SubTotal.value - Advance.value)
}
else event.value = 0
Total2
var SubTotal=this.getField("SubTotal");
var Advance=this.getField("Advance");
//Check for a positive value
if (SubTotal.value - Advance.value < 0)
{ event.value = (Advance.value - SubTotal.value)
}
else event.value = 0
event is calculate: - (JavaScript, client)
George Kaiser