Copy link to clipboard
Copied
Hi All,
Thaks to help from @Nesa Nurani I have been able to create a document with a second page that is shown or hidden depending on a basic drop down selection [Group96.picsnotes1] for the additonal page (Yes or No seletion).
The second page conatins 4 image boxes [image(1-4)_af_image] and a text field for notes [notes1] each of the image boxes and the notes field have a group prefix Group95.
I have used the following code in the validation script to show/hide the second page:
var p2 = this.getTemplate("Page2");
var p = Number(this.numPages)-1;
if(this.numPages != 1)
this.deletePages(1,p);
if (event.value == "Yes")
p2.spawn(numPages, false,false);
And the following in the custom calculation script to clear the images and notes:
Copy link to clipboard
Copied
Image field doesn't have value, so you can't reset it.
Read this: http://khkonsulting.com/2017/03/clear-image-field-pdf-form-acrobats-javascript/
Copy link to clipboard
Copied
Image field doesn't have value, so you can't reset it.
Read this: http://khkonsulting.com/2017/03/clear-image-field-pdf-form-acrobats-javascript/
Copy link to clipboard
Copied
Button images are not data, so resetting the button field has no affect. The only way to clear an image from a button (using JavaScript) is to load another image. I've used this technique before by placing a hidden button on the PDF that contains a blank image.
However, you can also make the image disappear by setting the "field.buttonPosition" property to "position.textOnly".
Find more inspiration, events, and resources on the new Adobe Community
Explore Now