Skip to main content
Participant
September 22, 2017
Answered

Sequential Number Generator in a PDF

  • September 22, 2017
  • 1 reply
  • 52564 views

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 has been closed for replies.
Correct answer Nesa Nurani

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.

1 reply

Hetal0D45
Participating Frequently
January 30, 2021

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

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
January 30, 2021

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.