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

Making calculations add faster

HR Lady4
Registered: Nov 2 2010
Posts: 25

Can a custom script be used to make multiple combo boxes update faster?
 
I have a box called "Overall Rating" and I want it to add "Section 1" and "Section 2"
 
Right now it is using the standard sum(+) but takes forever and sometimes doesn't update.

My Product Information:
Acrobat Pro 9.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
It's all in the details. There could be something that could be optimised or done differently to speed it up. If you can post a sample somewhere (e.g., Acrobat.com) we could take a look.

If it doesn't update correctly, there's probably a problem with the field calculation order, so you should confirm that it's set to something that makes sense for your form.
HR Lady4
Registered: Nov 2 2010
Posts: 25
Well.

I have a "Section 1" with the script:
// get the value of 'Score 1' and multiply it by 0.25 or 25%
event.value = this.getField("Score 1").value * 0.25;


I have a "Section 2" with the script:
// get the value of 'Score 2' and multiply it by 0.75 or 75%
event.value = this.getField("Score 2").value * 0.75;

I then have an "Overall Score"
this is using the standard value is (sum)+ "Section 1" and "Section 2"

but if you change the numbers in the other sections it changes Section 1 and Section 2 but the Overall Score doesn't change unless I write or delete data.
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
If those are the only calculations, it should not take very long at all. How long is it taking?

You need to check the field calculation order to make sure it is correct for your form.
HR Lady4
Registered: Nov 2 2010
Posts: 25
I have other pages with information. So on pages 1 and pages 2, the user has the option to pick values from 1-5, then at the bottom of those pages the "Score 1" on page 1 will average the values and page 2 the "Score 2" will average values from the combo boxes. The on page 3 the "Section 1" will grab the Score 1 and weight it 25% and Section 2 will grab the Score 2 and weight it 75%. Then the Overall is supposed to add Section 1 and Section 2 together.

But what happens it the user put in a score of 3 and the Score 1 change and the Section 1 change but the overall doesn't add up unless I start typing text next to the combo box field.
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
You need to check the calculation order of the fields.

George Kaiser

HR Lady4
Registered: Nov 2 2010
Posts: 25
I'm not too familiar with Acrobat. Are you talking about the tab order for the fields?
HR Lady4
Registered: Nov 2 2010
Posts: 25
I found it. Thank you it worked.