Skip to main content
October 12, 2016
Question

Unique ID on a PDF Form

  • October 12, 2016
  • 1 reply
  • 884 views

Hi there!

I am very new to JavaScript and seeking help with my issue.

I have a form that will be filled out by different people. They can download the file on our intranet. I need the form to auto-generate a unique ID when the form downloads however, once they "save" the filled out form, the generated number should stay.

I found a code that generates the unique ID but it changes when even the saved and filled ones are opened every time.

Is there a way to do this?

Thanks!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
October 12, 2016

Let's say the field that contains the ID is called "ID". Change your code to something like this:

if (this.getField("ID").valueAsString=="") {

// put here the code the populates the field with the unique ID

}