Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Counting Values selected from Dropdown menu

New Here ,
Mar 22, 2018 Mar 22, 2018

I need a little help. I am terrible with JavaScript on a good day.

I have a form used to audit project compliance. I've been manually counting the number of Findings on each audit. I assume there must be a way to have Adobe complete this task for me. All of the drop downs affected by this script are named "Finding." 1-14. I need to count all instances where there is a finding, omitting the selections of "OK - No Finding" or "Select" displaying the summed value in the "Count" field. TIA!

AuditCount.jpg

TOPICS
Acrobat SDK and JavaScript , Windows
264
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2018 Mar 22, 2018
LATEST

Yes, this can be done using a script. Enter this code as the custom calculation script of the "Count" field:

var total = 0;

for (var i=1; i<=14; i++) {

    var f = this.getField("Finding."+i);

    if (f.valueAsString!="Select" && f.valueAsString!="OK - No Finding") total++;

}

event.value = total;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines