Skip to main content
Participant
Jun 6, 2017 5:49 AM UTC
Question

drop down menu calculate

I have 48 fields (name of the fields: format1, format2 ... etc) with a drop down menu.

Options include:  store1, store2, store3, store4, store5, store6, store7, store8, store9. 

I want a numeric field to ONLY calculate the 1-9 options

This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

try67
Community Expert
Community Expert
Jun 6, 2017 8:42 AM UTC

You need to provide more information than that. This is a very vague description... Also, what exactly is your question?

Translate
CholeculaAuthor
Participant
Jun 6, 2017 3:12 PM UTC

i´m new in Javascript,

I created a fillable form using Acrobat.

In my document I have 48 drop down menus. (the name of each one dropdown menu is: format1, format2, format3, ... etc)

all the dropdown menu have 9 options inside ( store1, store2, store3, store4, store5, store6,store7, store8, store9)

I would like to count the number of times 'store1' was selected in a drop down list in multiple fields.

I need a script to do this.

I have more than 2 weeks trying, but I have not been able to do it

Translate
try67
Community Expert
Community Expert
Jun 6, 2017 3:23 PM UTC

Use this code as the custom calculation script of the text field where you want to display the result:

var total = 0;

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

    if (this.getField("format"+i).valueAsString=="store1") total++;

}

event.value = total;

Translate