How to Copy PDF Drop-Down Values and Text Fields to Another Set
Question details
The user wants to mirror text fields and drop-down selections from one group of PDF form fields to another using a checkbox, but standard value assignments overwrite or fail to preserve the drop-down options.

- Product
- PDF Editor
- Device & OS
- not provided
- Scenario
- Creating an interactive PDF form where checking a box automatically duplicates user input (text and drop-down choices) to a secondary set of fields.
- Observed behavior
- Assigning the raw value directly to the destination drop-down field does not preserve the drop-down selections and can unexpectedly replace the destination items.
Ensure your PDF editor supports JavaScript for forms and that you have a backup copy of your document before testing or modifying form scripts.
Use currentValueIndices to Preserve Drop-Down Items
Assigning the index instead of the raw value copies the user's drop-down selection without overwriting the available options in the destination field.
When transferring data between drop-down fields in a PDF, directly copying the value can strip the destination field of its unselected options. Using the currentValueIndices property ensures that you only change the active selection state while keeping the list intact.
Open your PDF in form editing mode, right-click the trigger checkbox that will duplicate the fields, and select Properties.
Navigate to the Actions tab. Select 'Mouse Up' as the trigger, choose 'Run a JavaScript' from the action list, and click Add.
In the script editor, test the checkbox state once and map the indices. For example: `if (event.target.value != 'Off') { this.getField('Acct2Objective').currentValueIndices = this.getField('Acct1Objective').currentValueIndices; }`
Within the same `if` block, copy standard text fields using the `.value` property. For example: `this.getField('Acct2_Note').value = this.getField('Acct1_Note').value;`

Use setItems() to Replace Destination Drop-Down Values
If your specific goal is to completely overwrite the drop-down options in the second field with the single selected value from the first field, use the setItems() method.
Edit and Manage PDF Forms Seamlessly with WPS PDF
WPS Office provides a comprehensive PDF Editor that allows you to seamlessly interact with, fill, and manage PDF forms without complex setups.
- 1. Open PDF Document: Launch WPS Office and open your interactive PDF file.
- 2. Access Form Tools: Navigate to the 'Form' or 'Fill & Sign' tab to access interactive field tools.
- 3. Interact with Fields: Click on any text field, checkbox, or drop-down menu to input your data or trigger embedded scripts.
- 4. Save the Document: Once your fields are filled, click the Save icon to preserve your data locally or to the cloud.

Frequently Asked Questions
Why does assigning a value to a PDF drop-down field clear its item list?
If you directly assign a value using methods like `setItems()`, the PDF viewer replaces the array of available choices with the new value. Using `currentValueIndices` ensures only the selected state changes, preserving the underlying drop-down list.
Can I copy multiple form fields with one checkbox action?
Yes, you can map multiple field assignments within a single JavaScript block. Just use one `if` statement to check if the box is ticked, and then list all your `.value` and `.currentValueIndices` assignments inside.
Do JavaScript form functions work in all PDF readers?
While standard Adobe Acrobat and robust PDF editors like WPS PDF support JavaScript form actions, some basic browser-based PDF viewers may not execute these scripts correctly. It is highly recommended to use a dedicated desktop PDF editor to fill advanced forms.




