Change a PDF Form Field Font from a Dropdown in Adobe Acrobat
Question details
Change the font of one or more PDF form fields based on a font selected in a dropdown list.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A PDF form author wants a dropdown selection to control the font of a text field.
- Observed behavior
- Selecting a font in the dropdown should immediately apply the corresponding font to the target field.
Open the PDF in Adobe Acrobat and make sure it has a dropdown and a target text field. Check the target field name and the dropdown option values in Prepare a Form; the script must match them exactly.
Add a validation script to the Acrobat font dropdown
Use this method to apply the selected font as soon as the dropdown value is committed.
In Adobe Acrobat, open the PDF and select Prepare a Form. Add a dropdown and a text field if they do not already exist.
Open the dropdown field's Properties and select Options. Add options with values Courier, Times, Helvetica, and Times Bold, then select Commit selected value immediately.
In the dropdown Properties, open the Validate tab, select Run custom validation script, and click Edit. Paste this script, replacing Text2 with the exact target field name: var f = this.getField("Text2"); switch (event.value) { case "Courier": f.textFont = font.Cour; break; case "Times": f.textFont = font.Times; break; case "Helvetica": f.textFont = font.Helv; break; case "Times Bold": f.textFont = font.TimesB; break; default: f.textFont = font.Symbol; }
Close the field properties, save the PDF, and exit form editing or use Preview. Select each dropdown option and check that the target field's text changes font.

Work with PDF and Office files in WPS Office
WPS Office is a free, lightweight alternative for everyday document and PDF work. Its familiar interface and Microsoft Office format support make it easy to move existing files into your workflow. Use Adobe Acrobat to configure and test the dropdown JavaScript described above.

Frequently Asked Questions
Why doesn't the font change immediately after I select an option?
In Prepare a Form, open the dropdown's Properties, select Options, and enable Commit selected value immediately. Also confirm that the script is under Validate and that the PDF viewer supports Acrobat JavaScript.
How can I change the font of more than one field?
In the dropdown's custom validation script, apply the selected font to each target field using this.getField("FieldName").textFont. Use the exact field names shown in Prepare a Form.
Can I use the script in a Mouse Up action instead?
Yes. In the dropdown's Properties, use Actions to add a Mouse Up JavaScript action and replace event.value with event.target.value. A validation script with immediate commitment is preferable when you want the change to happen as soon as the selection is committed.
What happens if a dropdown value doesn't match the script?
The default branch applies the Symbol font. Check the option or export values under dropdown Properties > Options and make sure they match the case labels exactly.




