Skip to main content
Participant
August 18, 2021
Question

Java script help

  • August 18, 2021
  • 1 reply
  • 259 views

Hello, I am recreating a form we use at work, and I am a novice at best when it comes to java script. The two things I want to accomplish are; One, have an auto generated number with either a two or four digit year as the prefix. This is for organization of the forms. Two, I want to be able to add photos to the form that can be viewed full size and/or printed when the form is accessed from its saved location. Can anyone help me with this? Any help will be greatly appreciated.

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
August 24, 2021

1. What kind of number do you want it to be, exactly? A sequential one? A random one? A time stamp?

And when should it update?

2. You can use an "image" field for that, but the size of the image will be determined by the size of the field, not the other way around.

Participant
August 26, 2021

Basically, I want to click the box and have it pull up a browse window so I can choose the file to upload to the document if that makes sense.

 

Thanks!

try67
Community Expert
Community Expert
August 26, 2021

Is the file supposed to be used in Reader?

If so, the only way to do that is with the Add File commenting tool, which can be applied manually or using a script. Here's an example how to add the comment to the first page, and then prompt the user to select a file:

 

var annot = this.addAnnot({
	page: 0,
	type: "FileAttachment",
	point: [400,500],
	contents: "Document added by the user",
});
annot.cAttachmentPath;