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

COUNT total fields that have entires

New Here ,
Oct 31, 2024 Oct 31, 2024

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
293
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
1 ACCEPTED SOLUTION
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;

View solution in original post

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

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

I have been fighting this for DAYS!

 

THANK YOUUUU!

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