PDF Editing Issues

Populate a PDF Shift Drop-Down Based on the Day in Adobe Acrobat

Chanuka GeekiyanageChanuka Geekiyanage Nov 24, 2026 868 views

Question details

Create a PDF form in which the available Shift choices depend on the selected Day.

Populate a PDF Shift Drop-Down Based on the Day in Adobe Acrobat
Product
Adobe Acrobat PDF forms
Device & OS
not provided
Scenario
A user selects a day in an Acrobat PDF form and needs the Shift drop-down to show only the shifts available for that day.
Observed behavior
The Shift list should update for the selected day and clear when no day is selected.
Before you start

Open the PDF in Adobe Acrobat and confirm that the form has Day and Shift drop-down fields. Check their exact field names and the Day choices' export values in Prepare a form.

Solution 1Recommended

Add a Day Field Validation Script to Update the Shift List

Use a custom validation script when the Shift choices must change with the selected Day.

1
Open the form editor

In Adobe Acrobat, open the PDF and select All tools > Prepare a form. Create or locate the Day and Shift drop-down fields.

2
Check field names and choices

Open each field's Properties. Confirm the Shift field is named "Shift 1", or substitute its actual name in the script. In the Day field's Options tab, include a blank choice and check the export values used for each day.

3
Add the validation script

In the Day field's Properties, open Validate, select Run custom validation script, and click Edit. Enter: var daysData = { "Monday": [["Early", "payrate3"], ["Mornings", "payrate1"], ["Afternoons", "payrate2"]], "Tuesday": [["Mornings", "payrate1"], ["Afternoons", "payrate2"]] }; var shift = this.getField("Shift 1"); if (event.value && Object.prototype.hasOwnProperty.call(daysData, event.value)) { shift.setItems(daysData[event.value]); } else { shift.clearItems(); }

4
Complete the day mapping

In the script editor, add entries for the remaining days and their available shifts. Match each object key to the corresponding Day choice's export value; each Shift pair contains a visible label followed by its export value.

5
Save and test the form

Close the Properties dialog, save the PDF, and preview the form. Select different days to check the Shift options, then select the blank Day choice to confirm that the Shift list clears.

Add a Day Field Validation Script to Update the Shift List
Commit the Day selection: If the list does not update immediately, open the Day field's Properties > Options and enable Commit selected value immediately. The script runs when the Day value is committed.
Free Microsoft Office alternative

Work with PDFs and Office Files in WPS Office

WPS Office is a free, lightweight alternative for everyday PDF and document work, with a familiar interface and Microsoft Office format compatibility for easier migration. The dependent PDF drop-down script described above requires an appropriate Acrobat form editor.

Open and work with PDFs alongside documents and spreadsheetsCompatible with Microsoft Word, Excel, and PowerPoint formatsUse a familiar interface for everyday office tasksAccess a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does the Shift list stay empty after I select a day?

In Prepare a form, check that the script uses the exact Shift field name and that each daysData key matches the Day option's export value. Also check for script errors in the custom validation script editor.

How do I clear the Shift list when no day is selected?

Add a blank choice in the Day field's Properties > Options. The script's else branch calls clearItems() when the committed Day value is blank or does not match a configured day.

What do the two values in each Shift option mean?

In setItems(), each pair contains the visible label first and the export value second. For example, ["Early", "payrate3"] displays Early while storing payrate3 as its value.

Can I use the same logic for several Day and Shift fields?

Yes. You can place shared mapping and update logic in a document-level JavaScript function, then call it from each Day field's custom validation script with the corresponding Shift field name.