Populate a PDF Shift Drop-Down Based on the Day in Adobe Acrobat
Question details
Create a PDF form in which the available Shift choices depend on the selected Day.

- 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.
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.
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.
In Adobe Acrobat, open the PDF and select All tools > Prepare a form. Create or locate the Day and Shift drop-down fields.
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.
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(); }
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.
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.

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.

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.




