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
  • 3020 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 8, 2019

This is not the script from my last post...Take the code from your reply #14.

If it's not working there's probably an error. You should check the JS Console.


Thx again all for your Help...now i solve the problem

Must've slept in to get the hang of it.

All well, thank you it was really a big help.

Wishes all a good and happy day, may everything work out

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.