Fix Acrobat Dropdown Selection Not Updating Year Fields Immediately
Question details
Update three PDF text fields with the previous years as soon as a year is selected from a dropdown.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A PDF form uses a year dropdown to calculate values for three text fields.
- Observed behavior
- The calculated fields update only after the user clicks away and reopens the dropdown because the selection is not committed immediately.
Open the PDF in Acrobat and identify the dropdown and the three destination field names in Prepare a Form. Check that the dropdown's stored values are four-digit years, not nonnumeric export values.
Commit the dropdown selection immediately and calculate each year field
Use this approach to recalculate the previous-year fields as soon as the dropdown selection is committed.
In Acrobat, open Prepare a Form, then double-click the year dropdown to open its Properties dialog.
On the Options tab, select Commit selected value immediately. Close the dropdown properties.
Double-click the first destination text field, open its Calculate tab, and select Custom calculation script. Click Edit and enter: var y = String(this.getField("YearDropdown").value); event.value = /^\d{4}$/.test(y) ? Number(y) - 1 : ""; Replace YearDropdown with the actual dropdown field name.
Open the Calculate tab for each of the other two text fields and add the same custom calculation script, changing - 1 to - 2 for the second field and - 3 for the third.
Save the PDF, exit form editing or select Preview, and choose a year from the dropdown. Confirm that all three fields update without clicking away.

Work with PDFs and Office files in WPS Office
WPS Office is a free, lightweight Office alternative with a familiar interface for working with PDFs and Microsoft Office files. Its format compatibility makes moving everyday documents straightforward, though it does not fix Acrobat's dropdown commitment or guarantee support for Acrobat JavaScript calculations.

Frequently Asked Questions
Why do the year fields update only after I click away?
The dropdown selection may not be committed until the field loses focus. In Prepare a Form, open the dropdown's Properties, select Options, and enable Commit selected value immediately.
Where should I put the year calculation script?
In Prepare a Form, open each destination text field's Properties and use Calculate > Custom calculation script > Edit. Set the script to read the dropdown and subtract the appropriate number of years.
What happens if the dropdown shows a placeholder instead of a year?
The example script checks for a four-digit value and leaves the calculated field blank when the dropdown contains a placeholder such as Select Year.
Why does the calculation work in Acrobat but not another PDF viewer?
The viewer may not support Acrobat JavaScript or may have scripting disabled. Test the saved form in Acrobat and check the viewer's JavaScript settings.




