Skip to main content
Nikolaos.
Inspiring
August 7, 2019
Answered

Acrobat Pro DC Textfelder addieren die ein bestimmten Text beinhalten

  • August 7, 2019
  • 3 replies
  • 2999 views

Hallo an alle,

brauche ein "bisschen" Hilfe

Wie kann ich mit Acrobat Pro DC (oder alternative Adobe LiveCycle Designer ES4) Textfelder addieren die ein bestimmten Textinhalt haben?

Bei einer anderen Textfeld reihe möchte ich Textfelder addieren die ein wert oder Text haben, wenn leer dann nicht zählen.

Ich weiß das dies mit Java möglich ist, als Laie weiß ich nur nicht wie

Danke für jede Hilfe im Voraus

Niko

This topic has been closed for replies.
Correct answer Nikolaos.

Change:

getField("10"+i)

To:

getField(i)


It does not add up the fields with content text

  var count = 0; 

    for (var i=10; i<=19; i++) { 

        if (this.getField(i).valueAsString != "") count++; 

    } 

    event.value = count; 

3 replies

Nikolaos.
Nikolaos.Author
Inspiring
August 7, 2019

Want you build the sum of fields or count the filled fields?

Both solutions would be great

Info: Acrobat uses Javascript, not Java.

You're right, sorry meant of course with javascript...as I said I'm still a beginner

Thx

Niko

Nikolaos.
Nikolaos.Author
Inspiring
August 7, 2019

Hi Bernd Alheit,

I want to use Acrobat Pro DC to add text fields that have a specific text content (what ever can be this text).

With another text field row I want to add text fields that have a value or text, if empty then don't count.

Thx

Niko

Bernd Alheit
Community Expert
Community Expert
August 7, 2019

You can use something like this:

var count = 0;

// for fields with specific text:

if (this.getField(" field name ").valueAsString == " specific text ") count++;

// for non-empty fields:

if (this.getField(" field name ").valueAsString != "") count++;

Nikolaos.
Nikolaos.Author
Inspiring
August 7, 2019

Thank you very much, great that it was so fast and accurate.

Could scream with joy

My last question, where is it inserted?

Text field properties in calculation or validation?

...or better, where and how exactly is this inserted?

Thx

Niko

Bernd Alheit
Community Expert
Community Expert
August 7, 2019

Want you build the sum of fields or count the filled fields?

Info: Acrobat uses Javascript, not Java.