Disappearing text from dropbox with javascript for mouse exit action
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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;
Copy link to clipboard
Copied
I forgot to add this reference from Thom Parker: https://acrobatusers.com/tutorials/using-colors-acrobat-javascript/
Copy link to clipboard
Copied
Use a custom format script to set the display to blank.
event.value = "";
Use the Acrobat JavaScript Reference early and often

