Skip to main content
Participant
Sep 22, 2017 6:04 PM UTC
Answered

Sequential Number Generator in a PDF

I have created a fill-able form in which i want to have the Work Order "WO" field generate a sequential number when I open the master form. When I save and close the form I want the number to remain the same and and generate a new number. I am using Adobe Acrobat Pro DC..

This topic is closed to new replies. Start a new post to keep the conversation going.
Nesa Nurani
Nesa NuraniCorrect answer
Community Expert
Jan 30, 2021 8:14 AM UTC

Select 'javascript' tool and then 'document javascript' or while in 'prepare form'tool press 'shift+d'
add new script and replace any code already in when you open window with this code:

var num = this.getField("Text1");
num.value = Number(num.value)+1;
num.defaultValue = num.value;

Change field name in code to the name of your field.

9 replies

Hetal0D45
Participating Frequently
Jan 30, 2021 6:18 AM UTC

The links are not working for me, I get 404 Not Found error.

Translate
Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
Jan 30, 2021 8:14 AM UTC

Select 'javascript' tool and then 'document javascript' or while in 'prepare form'tool press 'shift+d'
add new script and replace any code already in when you open window with this code:

var num = this.getField("Text1");
num.value = Number(num.value)+1;
num.defaultValue = num.value;

Change field name in code to the name of your field.

Translate