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

Disappearing text from dropbox with javascript for mouse exit action

New Here ,
Apr 07, 2020 Apr 07, 2020

I have a dropdown box with four different options that each turn the dropdown box into a different color if selected. When selecting the options, I have words appear for each option, so that the user knows what they are choosing. After they have made a selection, I want to the word they chose to disappear, so only the color is left within the dropdown box. The dropdown box is essentially a tool for color coding data. I think this can be easily done with JavaScript for a Mouse Exit Action, but I don't know the code. Any help is much appreciated!

TOPICS
Create PDFs , Edit and convert PDFs , How to , PDF forms
659
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 Expert ,
Apr 07, 2020 Apr 07, 2020

Use the Acrobat JavaScript Scripting Reference :

 https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/Acro6JS1.pdf

 

Look the at the keyword table and the example found in Pages 96 -97

 

The code would in the example looks like this: 

 

 

var f = event.target; /* field that the event occurs at */
f.target.textColor = event.value < 0 ? color.red : color.black;

 

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 Expert ,
Apr 07, 2020 Apr 07, 2020

I forgot to add this reference from Thom Parker: https://acrobatusers.com/tutorials/using-colors-acrobat-javascript/

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 Expert ,
Apr 07, 2020 Apr 07, 2020
LATEST

Use a custom format script to set the display to blank.

 

event.value = "";

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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