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 ?
Copy link to clipboard
Copied
Buttons doesn't have this property.
Copy link to clipboard
Copied
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.