Copy link to clipboard
Copied
Hello there,
I'm trying to create a form that has a labeled image insertion section. To do this, I put text instructions "Click here to Add Image" in the middle of where I want the image, then I added the Image field with "no fill" on top of that text. This worked great when I inserted a jpeg file because the image covered up my text. But then I tried inserting a pdf into this space, and my "Click here" text shows right through. (see image). How do I make it so that when someone inserts the image, the text disappears? Thank you!
Copy link to clipboard
Copied
You can change the fill color of the field when it is clicked, like this:
event.target.fillColor = color.white;
if (event.target.buttonImportIcon()!=0) event.target.fillColor = color.transparent;
The last line of code will change it back to transparent if the user didn't select an image or it failed for some reason.
Copy link to clipboard
Copied
At the image field use a image with the text "Click here to Add Image" .
Copy link to clipboard
Copied
You can change the fill color of the field when it is clicked, like this:
event.target.fillColor = color.white;
if (event.target.buttonImportIcon()!=0) event.target.fillColor = color.transparent;
The last line of code will change it back to transparent if the user didn't select an image or it failed for some reason.
Copy link to clipboard
Copied
What if the background colour is a specific RGB off white, how would you set the fillColour value?
Copy link to clipboard
Copied
You can specify a specific RGB value like this:
event.target.fillColor = ["RGB", 0.25, 0.9, 1];
Notice the values are between 0 and 1, not 0 and 255, as in other places.
To convert the latter to the former just divide your values by 255.
Copy link to clipboard
Copied
Worked perfectly. Thanks!