Calculating Combobox into text field.

New Here ,
Aug 08, 2022 Aug 08, 2022

Copy link to clipboard

Copied

Thank you in advance.

so my scenario, my pdf has 15 combobox/dropdown with the same menu. for example purpose say the menu consists of 5 options which is 

(A)

(B)

(C)

(D)

(E)

I also have 5 Text fields labeled with the 5 options.

how can I make it where. if my comboboxes have option (A) selected. then in the text field would calculate the amount of comboboxes with that option selected? and same goes for all the other options?

 

Thank you once again!

TOPICS
Create PDFs , JavaScript

Views

22

Likes

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
Community Expert ,
Aug 08, 2022 Aug 08, 2022

Copy link to clipboard

Copied

LATEST

Let's say your dropdown fields are named "Dropdown1"-"Dropdown15", as custom calculation script of field where you want to show result "A" use this:

var total = 0;
for(var i=1; i<=15; i++)
if(this.getField("Dropdown"+i).valueAsString == "A")total++;
event.value = total;

 

In dropdown field properties → option tab → check 'Commit selected value immediately'.

You can easily adapt the script for other fields.

Likes

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