Skip to main content
Participant
October 31, 2024
Answered

COUNT total fields that have entires

  • October 31, 2024
  • 1 reply
  • 396 views

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.)

 

This topic has been closed for replies.
Correct answer PDF Automation Station

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;

1 reply

PDF Automation Station
Community Expert
Community Expert
October 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;
Participant
October 31, 2024

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

I have been fighting this for DAYS!

 

THANK YOUUUU!