Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


How to make a button/(add)image as a required field before print

New Here ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

Hi all, I've been struggling for a while on this. 
I'm doing a form in which i'm asking people to add their info + their photo and then print the Pdf.

I haven't had any problem with setting all the field as required but I can't make it work on the "add image".
I've even tried to set up a regular button with this script " event.target.buttonImportIcon() " (that I found online) as a way to try to go arourd the restriction, but it seems that buttons cannot be required either. I'm lost and I've work so hard on this to give up. Any help please ?

TOPICS
Create PDFs, Edit and convert PDFs, How to, JavaScript, PDF forms

Views

29

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

Buttons doesn't have this property.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 30, 2021 Jun 30, 2021

Copy link to clipboard

Copied

LATEST

As mentioned, buttons can't be set as required because technically they don't have a value (an image is not a value).

However, there are ways around it. You can use a script to populate a (hidden) text field with the return value of buttonImportIcon, so when the user fills it in you'll be able to know it and validate it before the file is submitted.

 

There are other complications, though. For example, resetting the form will not clear the images from the buttons. You will need to use a special script to do that, etc.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines