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

COUNT total fields that have entires

New Here ,
Oct 31, 2024 Oct 31, 2024

Copy link to clipboard

Copied

I have looked through all the community posts and tried to edit examples to work on my document - but they do not work.  Please HELP 🙂

 

I have 40 fields that will have both numbers and text entered. 

The fillable text fields are named:

Room0

Room1

Room2

Room3

continuing and ending with Room39

 

In the field "Room Total" I need it to count the number of fields above that have an entry in it (not calculate the total, but count.)

 

TOPICS
JavaScript , PDF , PDF forms

Views

154

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

Community Expert , Oct 31, 2024 Oct 31, 2024

Enter the following custom calculation script in Room Total field:

var count=0;
for(var i=0;i<40;i++)
{
if(this.getField("Room"+i).value)
{count++;}
}

event.value=count;

Votes

Translate

Translate
Community Expert ,
Oct 31, 2024 Oct 31, 2024

Copy link to clipboard

Copied

Enter the following custom calculation script in Room Total field:

var count=0;
for(var i=0;i<40;i++)
{
if(this.getField("Room"+i).value)
{count++;}
}

event.value=count;

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
New Here ,
Oct 31, 2024 Oct 31, 2024

Copy link to clipboard

Copied

LATEST

I have never been so grateful for anything in my life 🙂

I have been fighting this for DAYS!

 

THANK YOUUUU!

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