This conversation has been locked due to inactivity. Please create a new post.
This conversation has been locked due to inactivity. Please create a new post.
Is there some way to add JavaScript to run when a user attaches a file?
Solved! Go to Solution.
Views
Replies
Total Likes
Topics help categorize Community content and increase your ability to discover relevant content.
Hi,
There is not event that fires, but you could control the JavaScript to add the attachment using the importDataObject (see the Acrobat JS API Reference document for details), if you don't specify the cDIPath parameter it will display a dialog.
You could then run additional JavaScript after you have made the above call, the function returns true if it was able to import the file and therefore you could use this to control if you run you code or not.
The Acrobat JS API reference document can be downloaded as part of the SDK from here - http://www.adobe.com/devnet/acrobat/sdk/eula.html
or the online version is here - http://livedocs.adobe.com/acrobat_sdk/10/Acrobat10_HTMLHelp/JS_API_AcroJSPreface.87.1.html
To use the 'doc' object from acrobat in LiveCycle Designer change the 'doc' part to 'event.target'
Hope this helps
Malcolm
Views
Replies
Total Likes
Hi,
There is not event that fires, but you could control the JavaScript to add the attachment using the importDataObject (see the Acrobat JS API Reference document for details), if you don't specify the cDIPath parameter it will display a dialog.
You could then run additional JavaScript after you have made the above call, the function returns true if it was able to import the file and therefore you could use this to control if you run you code or not.
The Acrobat JS API reference document can be downloaded as part of the SDK from here - http://www.adobe.com/devnet/acrobat/sdk/eula.html
or the online version is here - http://livedocs.adobe.com/acrobat_sdk/10/Acrobat10_HTMLHelp/JS_API_AcroJSPreface.87.1.html
To use the 'doc' object from acrobat in LiveCycle Designer change the 'doc' part to 'event.target'
Hope this helps
Malcolm
Views
Replies
Total Likes
Thanks for the response. I do already have code for adding the attachments. The users still want to add additional attachments through the built in functionality. This question was just an alternative solution to a problem I resolved in another way. I had code in the preSubmit event that dealt with attachments. preSubmit does not fire when saving a draft in workspace. If there were an event, i would run the code each time a file were attached. I ended up putting code in the form bridge in the function called when Save is clicked.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies