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

How to create "attach file" button


Level 1

I have been searching for days on how to insert a working "attach file" button into a PDF form I'm creating. I am working with LiveCycle ES4. I am able to open other examples where the "attach file" button works but when I try to implement in my own form, it doesn't work. I have tried using script from several examples but none work when I try to implement in my own PDF. Do I need to enable rights via LiveCycle somehow?

I have already tried the following:

//////////////////////////////////////////////////////// with this option, nothing happens when I click the button ////////////////////

form1.#subform[0].AddAttachment::click - (JavaScript, client)

var oObj =;

var fileAttachments = oObj.dataObjects;//dataObjects returns all dataObjects(attachments)in the pdf

if(attachmentsList.length > 0)




        var oDataObj = oObj.getDataObject(fileAttachments.length);


        console.println("The attachments size is...."+fileAttachments.length);

        NoOfAttachments.rawValue = fileAttachments.length+1;





    //we need to associate each file attachment  imported into the document with a key

    //then get the file attachment's name and add it to the drop down list


        var oDataObj = oObj.getDataObject(counter.value);


        NoOfAttachments.rawValue = 1;




0 Replies