These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Late update to a text field when totalling buttons

mceniry
Registered: Oct 24 2011
Posts: 5
Answered

Hi I've got 11 radio buttons that get summed by the standard "Value is the sum(+)" in one text field (Subtotal) that I'm trying to use in another text field (Total) to set some text based on the total of the buttons. There seems to be a delay in the values being propagated from Subtotal doing the totalling and the text field(Total) evaluating totals. Like when the button total text field(Subtotal) updates, the other text box that should also "see" the updated value does not until another button is clicked on and then the Total "sees" the previous value and not the updated. Is there a way to synchronize these.
 
Here's the code from the 2nd text field (Total):
var mySubt = getField("Subtotal").value;
var myTotalTxt = getField("Total");
 
if (mySubt <= 0)
{ myTotalTxt.value=" ";
}
else
{ event.value= getField("Subtotal").value;
}
 
When field Subtotal gets updated Total reflects the previous
Subtotal value. Click another Button and Subtotal gets updated
correctly but again Total see preious value that was in Subtotal.
 
What's the trick to fix this?
 
Thanks!!

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Accepted Answer
You have a problem with the calculation order. If you are using Acrobat 10, set the calculation order in "Form Edit" mode. On the Edit panel, select "More Tasks -> Edit Fields -> Calculation Order".


Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script