Create PDF Buttons That Show Different Messages in Adobe Acrobat
Question details
Create PDF form buttons that display different messages when clicked.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A PDF form needs separate buttons that each show a specific message or value.
- Observed behavior
- Clicking a button should update a text field with its assigned message or show a temporary alert.
Open the PDF in Adobe Acrobat and check that you can access the Prepare a form tool. Decide whether messages should remain visible in a text field or appear temporarily in an alert.
Update a text field with each button's message
Use this method when the selected message should remain visible on the PDF form.
In Acrobat, open All tools > Prepare a form, add a text field, and name it Text1.
In Prepare a form, add a button or right-click an existing button and select Properties.
On the Actions tab, select Mouse Up as the trigger and Run a JavaScript as the action. Click Add and enter: this.getField("Text1").value = "Message for Button 1";
Open Properties > Actions for each remaining button and add its own Mouse Up JavaScript action. Use the same Text1 field name but change the message in each script.
Click Preview in Prepare a form, then click each button and confirm that Text1 displays the expected message.

Show a temporary alert for each button
Use an alert instead of a text field when the message only needs to appear temporarily.
Work with PDFs and Office files in WPS Office
WPS Office is a free, lightweight alternative for everyday document work, with a familiar interface and support for common Office formats to make migration easier. Use Acrobat for the PDF button JavaScript described above; WPS Office is not a replacement for that configuration.

Frequently Asked Questions
Can all buttons write to the same text field?
Yes. Give each button a Mouse Up JavaScript action that refers to the same field, such as Text1, and assign a different message in each script.
Why does clicking a button do nothing?
Check the button's Properties > Actions tab for a Mouse Up action set to Run a JavaScript. Also verify that the field name in the script matches the text field name and that your PDF viewer allows JavaScript.
How do I display a message without adding a text field?
In the button's Properties > Actions tab, add a Mouse Up action that runs JavaScript such as app.alert("Your message");.
Will the buttons work in every PDF viewer?
Not necessarily. PDF viewers differ in their support for form JavaScript and may block it for security reasons. Test the saved file in the intended viewer.




