Copy link to clipboard
Copied
Hi everyone,
I am new to adobe and also new to Javascript and learning as i go, so any help would be fantastic. The situation is i have created a form to be sent out to customers and filled in with data required. I have a warning that will pop up when clicking the submit button which will ask to fill in specified fields that may have been missed - this works great.
I have also added tick boxes asking if a picture can be provided (as an attachment in the PDF), once this box is ticked i have managed to get it to show a button, once this button is pressed it opens windows file explorer and the attachment panel in adobe.
what i am now trying to add is. If the tick box that asks if you can provide a picture (attachment) is ticked. when the submit button is pressed it will check if the PDF has had any attachments added before sending.
I have had the form returned to me a couple of times where a customer has ticked they can provide a picture. But not attached one.
Thanks,
James.
Copy link to clipboard
Copied
In the Acrobat JavaScript model, attachements are called "DataObjects". There is a "dataObjects" property of the document object. If it is null, then there are no attachments.
For example:
if(this.dataObjects){
... perform submit ...
}else
app.alert(" Please provide an attachment");
Copy link to clipboard
Copied
Brilliant, Thank you!