How to Add Disappearing Placeholder Text in PDF Forms
Question details
The user wants to add instructional or placeholder text inside a PDF text field that automatically vanishes when a user clicks into the field or begins typing.

- Product
- PDF Editor
- Device & OS
- not provided
- Scenario
- Creating interactive PDF forms with instructional hints for users to guide their input.
- Observed behavior
- The user needs a method to display instructional text that disappears upon entry so the user's actual input replaces it seamlessly.
Ensure you have a professional PDF editor that supports interactive form creation and JavaScript functionality, as basic PDF readers cannot configure dynamic field behaviors. Always keep a backup copy of your original PDF document before applying custom scripts.
Use Custom JavaScript to Control Text Field Visibility
Use a calculation or validation script to show an instructional label when the field is empty and hide it once the user inputs data.
To achieve a true 'type-over' effect that disappears upon user interaction, you can overlay a read-only instructional text field on top of the actual input field and control its visibility using form JavaScript.
Open your PDF form editor, select the 'Text Field' tool, and draw the main input field where users will type their information.
Draw a second text field directly over the first one. Enter your instructional placeholder text as its Default Value, make it read-only, and remove any background or border colors.
Open the Properties of the main input field. Navigate to the 'Actions' or 'Format' tab, and add a custom JavaScript to the 'On Blur' or 'Calculate' trigger. The script should check if the main field has a value; if it does, set the instructional field's visibility to hidden, otherwise set it to visible.
Exit form editing mode and test clicking into the field and typing. Verify that the instructional text disappears as expected in a supported PDF reader.

Use Tooltips as a Simple Alternative
If JavaScript is too complex or incompatible with your users' PDF readers, use the built-in Tooltip feature to provide instructional hints.
Easily Create Interactive PDF Forms with WPS Office
WPS PDF provides a comprehensive set of tools to create, edit, and fill interactive PDF forms, making it simple to add text fields, configure tooltips, and manage form properties.
- 1. Open the PDF document: Launch WPS Office and open your target PDF file. Navigate to the 'Form' tab in the top ribbon.
- 2. Add a Text Field: Click on the 'Text Field' icon and drag your cursor to draw the input box on your document.
- 3. Configure Properties: Double-click the new field to open the Properties menu. Here you can add instructional text in the Tooltip section or set a Default Value.
- 4. Save the form: Close the properties window and save your document. The form is now ready to be distributed and filled out.

Frequently Asked Questions
Why doesn't my JavaScript type-over text work when opening the PDF in a web browser?
Built-in browser PDF viewers (like Google Chrome, Safari, or Microsoft Edge) often have limited or no support for PDF JavaScript. For interactive scripts to run correctly, users must open the forms in dedicated PDF applications like WPS Office or Adobe Acrobat.
Can I format the default text to look like a light gray placeholder?
Yes, you can set the default text color to light gray in the text field's Appearance properties. However, without a custom script, the user's typed text will also remain light gray. A script is usually required to change the text color back to black when the user starts typing.
Is there a difference between a tooltip and placeholder text in PDFs?
Yes. A tooltip appears as a temporary, small pop-up box only when the user hovers their mouse pointer over the field. Placeholder (type-over) text sits directly inside the text box itself and is visible until the user interacts with the field.




