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

Tallying answers in textboxes

Explorer ,
Feb 29, 2020 Feb 29, 2020

Copy link to clipboard

Copied

I have 15 rows of radio buttons. The export values are Reinforce, Refine and Redirect and they appear at the end of each row of buttons in a textbox. I would like to tally the number of times each value is selected and show it in 3 separate textboxes.

Example: Number of times Reinforce is selected. Number of times Refin is selected, etc.

 

All of you who answer here are amazing! I really appreciate what you do!

TOPICS
Acrobat SDK and JavaScript

Views

225

Translate

Translate

Report

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

correct answers 1 Correct answer

Explorer , Feb 29, 2020 Feb 29, 2020

I found the answer. Thanks!

Incase someone else needs something like this, here it is

I have 3 textboxes and changed the other box scripts var testFor values to Refine and Redirect.

The textfields are named RGBGroup.1, RGBGroup.2, up to .15:

 

var testFor = "Reinforce";
var groups = this.getField("RGBGroup");
var ar = groups.getArray();
var cnt = 0;
for (var i=0; i<ar.length; i++) {
if (ar[i].value == testFor) {
cnt++;
}
}
event.value = cnt;

Votes

Translate

Translate
Explorer ,
Feb 29, 2020 Feb 29, 2020

Copy link to clipboard

Copied

LATEST

I found the answer. Thanks!

Incase someone else needs something like this, here it is

I have 3 textboxes and changed the other box scripts var testFor values to Refine and Redirect.

The textfields are named RGBGroup.1, RGBGroup.2, up to .15:

 

var testFor = "Reinforce";
var groups = this.getField("RGBGroup");
var ar = groups.getArray();
var cnt = 0;
for (var i=0; i<ar.length; i++) {
if (ar[i].value == testFor) {
cnt++;
}
}
event.value = cnt;

Votes

Translate

Translate

Report

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