How to Create Instructional Ghost Text for Fillable Forms in Acrobat Pro

Опубликовано: 01 Март 2025
на канале: My CG Tutor
136
3

Learn how to add Instructional Ghost Text to fillable forms in Adobe Acrobat Pro using JavaScript. Ghost text provides helpful hints or placeholder text within form fields, guiding users while maintaining a professional design. When users interact with the field, the ghost text disappears, and when the field is empty, the text reappears.

To implement this functionality, you'll need to add custom JavaScript to your form fields using the following scripts:

Custom Format Script
This script ensures the ghost text appears in the field by default and stays hidden when printed. Change "Instructional text goes here" to whatever you want the Ghost Text to appear as. Remember to keep the quotations!

Custom Format

if (!event.value) {
event.value = "Instructional text goes here";
event.target.display = display.noPrint;
} else {
event.target.display = display.visible;
}


On Focus Script
This script clears the ghost text when the user clicks or tabs into the field and sets the text color to black for user input.


if (event.target.value == event.target.defaultValue) {
event.target.value = "";
event.target.textColor = color.black;
}

On Blur Script
This script restores the ghost text and changes the text color to light gray if the field is left empty.

if (event.target.value == "") {
event.target.value = event.target.defaultValue;
event.target.textColor = color.ltGray;
}


This setup ensures your forms remain intuitive and user-friendly while providing visual clarity during interaction and printing.