Locked

Sequential Number Generator in a PDF

New Here ,
Sep 22, 2017 Sep 22, 2017

Copy link to clipboard

Copied

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..

TOPICS
PDF forms

Views

20.0K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Jan 30, 2021 Jan 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.

Likes

Translate

Translate
Adobe Employee ,
Sep 22, 2017 Sep 22, 2017

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 29, 2021 Jan 29, 2021

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

It gives me an error message:  syntaxError: missing (before formal parameters 1: at line 2

Is there something I have to setup before adding this script to the pdf?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

Hetal0D45, please go to your PDF and copy/paste here the exact code you currently have.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

I don't have any right now.  Nothing has worked for me so far.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

Yes, but you had some when you got the error message. As a programmer, you need to give both the source code AND the error message, at the same time. Telling us "nothing works" doesn't help us to help you; you are the programmer.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

No I am not a programmer, but I tried the following script that is already in this thread from Nesa Nurani:

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

I am just an Adobe user that is trying to create sequential forms in Adobe Acrobat Pro DC.  I have tried for months to get help from Adobe Help line, but after many hours and months of being transferred from one agent to another, finally decided to search the web to see if someone else has a solution to my issues.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 30, 2021 Jan 30, 2021

Copy link to clipboard

Copied

LATEST

I got it to work. Thank you.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines