how do I add an incremental counter to a button

I want a button to act as an incremental counter, updating a text field with a number each time the button is clicked

Julian Pike

Voted Best Answer

Assuming that this is an AcroForm, place this script on the MouseUp event of the button

var oFld = this.getField("IncrementField");
oFld.value = 0;
oFld.value += 1;

Where "IncrementField" is the name of the field you want incremented.

Thom Parker
The source for PDF Scripting Info
All About PDF Stamps in Acrobat and Paperless Workflows - THE BOOK !!

The Acrobat JavaScript Reference, Use it Early and Often

The most important JavaScript Development tool in Acrobat
The Console Window (Video tutorial)
The Console Window(article)

Having trouble, Why Doesn't my Script Work

By Thom Parker   

Please specify a reason: