Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Adding multiple buttons to attach files

Avatar

Level 1

I created a form and I have multiple buttons that say "Attach" and when clicked will allow a user to attach a file to the PDF. The file name then shows up in the text field next to it. I am running into a problem though. When I attach a file using button1 it will work. Button2 will attach another file and it shows up in the attachments ... but when I save and close it and reopen it, only the last file I attached is saved in attachments. Is it because I used the same JavaScript for all my buttons (besides changing the TextField name?? Here is the script I used:

var myDoc = event.target;

var sFile;

myDoc.importDataObject(sFile);

var myDataObject = myDoc.getDataObject(sFile);

TextField10.rawValue = myDataObject.path;

ANY help would be great. I'd like to have button1 attach a file, button2 attach a different file, etc. And they all be saved and available when reopened.

1 Reply

Avatar

Level 7

Is there any way you can send the file?