I'm creating an employee evaluation form using Acrobat Pro DC. I have dropdown boxes for the evaluators to assign a ranking of 1 - 5 for each of twenty-five predescribed statements (e.g., "Excerses good judgement") in five categories (e.g., "Leadership", "Job Knowledge"). At the end of each category there is a field showing the average ranking for the five statements in that category. At the end of the categories there is a field (TotalAvgs) that tallies the five averages. Based on that total I wish to autopopulate a checkbox (or other type of box) in front of the applicable performance rating:
* Does Not Meet Expectations (<15)
* Meets the City's High Expectations (15-19.9)
* Exceeds Expectations (20-22.9)
* Far Exceeds Expectations (23-25)
Not to be pesky but I forsee having two other questions, which I'll bring up after this one, related to Populating a header on all but the first page with the employee's name and How to have the document saved and emailed to the next approver of the evaluation after each signs (e.g. Supervisor, Department Head, HR, City Manager).
Thank you for any help.
What's the name of the text field with the result, and what are the names of the check-box fields?
Hello Most Valuable Participant try67,
Thank you for responding. The name of the text field with the result is TotalAvgs and the names of the four checkboxes are NotMeet, Meet, Exceed, FarExeed.
Use this code as the custom validation or calculation script of the TotalAvgs field:
var v = event.value; this.getField("NotMeet").checkThisBox(0, (v<15)); this.getField("Meet").checkThisBox(0, (v>=15 && v<20)); this.getField("Exceed").checkThisBox(0, (v>=20 && v<23)); this.getField("FarExeed").checkThisBox(0, (v>=23));
PS. Are you sure the last check-box is not called "FarExceed"?
Mr. Try67, You totally called it! You created the script using my precise descriptions and then warned that it might be incorrect. It was. I corrected the spelling from FarExeed to FarExceed in the last checkbox and bingo! It works! Where can I send a Starbucks gift card?
Thank you so much!
No checkboxes are checked as a result of the value in TotalAvgs. I'm getting an error message in the console when changing any of the twenty-five dropdowns.
ReferenceError: v is not defined
2:AcroForm:TotalAvgs:ValidateException in line 2 of function top_level, script
The total for TotalAvgs is achieved by a calculation (sum of five Rank Avg). I applied your script as a Validation script. I've been trying to go through and verify that all texts in all fields are correct. Now, when I change any of the twenty-five dropdowns I get the following error message:
Exception in line 1 of function top_level, script AcroForm:TotalAvgs:Validate
That tells you there is an error on line 1. Please post the validation code you are using.
It's working fine for me... Did you change the code in any way?
I have gone back through multiple times to verify no typing errors. I cut and pasted your script as a validation script to run along with the simple calculation that provides TotalAvgs its value. When I change any of the dropdowns I get the following error:
I just recreated all the fields in a new document. I cut and paste the script and get the following error message whenever changing any of the dropdowns. Thank you for any help you can offer.
Is there a way to not have the NotMeet check-box checked when the form is cleared and TotalAvgs reads 0?
Never mind. I learned a little something from try67 and added 0, (v>=1&&v<15)). Thanks Coach!