Field not updating correctly after selection change
I don't like that I have to ask what seem like such simple questions. Every time I think I understand some of it... doesn't seem to work out.
I have an order form with a bunch of tables and total fields. At the top I have a drop down to select what the PaymentMethod is, and I have 3 read-only text fields for Subtotal, processing fee, and Total. I got a script to work on the Fee field. A fee is only applied if Credit Card or PayPal is selected from the PaymentMethod dropdown. Otherwise do nothing (leave the fee as 0). The Subtotal field uses the basic sum calculation (selected all the table Total fields and let Acrobat figure out the script). The Overall Total is set to be a simple sum of the Subtotal and Fee fields (selected the 2 fields and let Acrobat figure out the script). The problem is the Overall Total doesn't seem to update correctly. It might work the first time, but then I either change a value in a table row's total or I change the PaymentMethod, and the Overall Total doesn't update properly. Example:
- PaymentMethod = US Check (so should be 0 for the fee), Subtotal = 110, fee shows 0, Total = 110.
- If I change the PaymentMethod to PayPal, subtotal = 110, fee = 3.85, total = 110.
- If I further change a value and the subtotal updates to $285.00, fee updates to $9.98, and total updated to $288.85. That's only about $3 more, not the $9.98 more.
Any thoughts on why my Total field isn't updating upon changes occurring?
Don't know if it is helpful, but here's the script that is on the fee field.
var PayType = this.getField("PaymentMethod").valueAsString;
var Subtotal = this.getField("WOSubtotal").value;
if (PayType == "PayPal" || PayType == "Credit Card") {
event.value = Subtotal * 0.035 }
else {
event.value = 0; }Thanks in advance!
