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

Hide and show a text field based on icon selection

Community Beginner ,
Jul 13, 2023 Jul 13, 2023

I would like to know a Script that can make a normal text balloon disappear and appear based on the image selection through an "ImportIcon". I want that, when he selects an image, whatever it is, the "Text1" field is hidden, and when this image is out, it is visible.

TOPICS
How to , JavaScript , PDF
535
Translate
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 Employee ,
Jul 13, 2023 Jul 13, 2023

Hi @Lucas 1231048268dhlp 

 

We have had several similar discussions where Java Script was used to perform a similar task. Please go through this discussion and see if it could be helpful. 

 

https://community.adobe.com/t5/acrobat-discussions/javascript-to-hide-show-text-field/m-p/11744572

https://community.adobe.com/t5/acrobat-discussions/show-hide-text-field-based-on-a-number-in-another... 

 

Thanks,

Akanchha

Translate
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 Beginner ,
Jul 13, 2023 Jul 13, 2023

I'm sorry, but they didn't help at all. I wanted one. Code that manages to hide a field based on whether an icon is selected or not. Example: we have the field "Text" and "IMG". If the "IMG" contains any icon or image, whatever it may be, the "Text" field will have to be hidden; if not, it is visible.

Translate
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 Beginner ,
Jul 13, 2023 Jul 13, 2023

These codes, the way I've seen it, tried it and tried to improve it, just make the balloon disappear. It doesn't "read" whether or not it has an image to define the state of the "Text" balloon.

Translate
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 ,
Jul 14, 2023 Jul 14, 2023
LATEST

test this,:

//Check if an image is inserted

var buttonIcon = this.getField("Bild einfügen").buttonGetIcon();
try {
var buttonIconStream = util.iconStreamFromIcon(buttonIcon);
;
} catch (e) {
app.alert("Sie haben kein Bild hochgeladen");
}

Translate
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