Skip to main content
Known Participant
April 16, 2021
Answered

Calculating the values of fields and displaying the result totals

  • April 16, 2021
  • 1 reply
  • 2665 views

I have a form that our employees use to conduct performance evaluations on our various sites. One example would be "site cleanliness," and the options for evaluation in the field would be "compliant", "non-compliant", "repeat non-compliant", "N/A." How would I go about adding up these responses and outputting the total to a field at the bottom. Does this require javascript? I am using Adobe Acrobat Pro DC

This topic has been closed for replies.
Correct answer Nesa Nurani

Do you have an idea of how I would calculate the scoring criteria as follows? 

Initial Periodic Score (1-5)
Scoring Criteria
5.0 = No deficiencies4.0 = No A deficiencies, less than 30% B deficiencies, less than 50% C deficiencies3.0 = Less than 3 A deficiencies, less than 50% B deficiencies, greater than 50% C deficiencies2.0 = Less than 7 A deficiencies, greater than 50% B deficiencies1.0 = More than 8 A deficiencies


Like I said it would be better to see  file with all fields, you can try something like this if you use percentage from 75 fields.

var x = Number(this.getField("Total").value);
var xda = Number(this.getField("DeficienciesA").value);
var xdb = Number(this.getField("DeficienciesB").value);
var xdc = Number(this.getField("DeficienciesC").value);
if(x == 0)
event.value = "";
else if(xda == 0)
event.value = 5.0;
else if(xda == 0 && xdb < 22.5 && xdc < 37.5)
event.value = 4.0;
else if(xda < 3 && xdb < 37.5 && xdc > 37.5)
event.value = 3.0;
else if(xda < 7 && xdb > 37.5)
event.value = 2.0;
else if(xda > 😎
event.value = 1.0;
else event.value = "";

1 reply

Inspiring
April 16, 2021

Yes, you need javascript.

Can you describe how you imagine process, one field to show total, total of what choice?

Or separate fields, one for each choice?

Field names? how many fields?

PhilaGuyAuthor
Known Participant
April 16, 2021

 People will be selecting choices like "deficient", "compliant", "repeat deficient", "N/A" in the analysis column and I want to add those values up to display in the scoring table at the bottom. Each row also has a value of "A", "B", or "C" assigned to it to show the level of importance of each analysis and I also want to calculate the number of choices sorted by the A B, and C importance.  Each of the analysis columns that I want to record scores from are labeled with this convention: "AnalysisA1"(first analysis cell that's valued with "A" importance), "AnalysisA2"(second analysis cell valued at "A" importance), "AnalysisB1" etc.

The most complicated portion for me will be the "Initial Periodic Evaluation Score" Calculation:   

5.0 = No deficiencies
4.0 = No A deficiencies, less than 30% B deficiencies, less than 50% C deficiencies
3.0 = Less than 3 A deficiencies, less than 50% B deficiencies, greater than 50% C deficiencies
2.0 = Less than 7 A deficiencies, greater than 50% B deficiencies
1.0 = More than 8 A deficiencies

Inspiring
April 16, 2021

It would be much easier if you could share a file with us to see the actual fields