• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Creating a disappearing Add Image Button

New Here ,
Aug 27, 2020 Aug 27, 2020

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!

 

text.png

TOPICS
Create PDFs , How to , PDF forms

Views

331

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

correct answers 1 Correct answer

Community Expert , Aug 28, 2020 Aug 28, 2020

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.

Votes

Translate

Translate
Community Expert ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

At the image field use a image with the text "Click here to Add Image" .

Votes

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
Community Expert ,
Aug 28, 2020 Aug 28, 2020

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.

Votes

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
New Here ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

LATEST

Worked perfectly.  Thanks!

Votes

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