PDF Editing Issues

How to Copy PDF Drop-Down Values and Text Fields to Another Set

Chanuka GeekiyanageChanuka Geekiyanage Nov 10, 2026 868 views

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.

How to Copy PDF Drop-Down Values and Text Fields to Another Set
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.
Before you start

Ensure your PDF editor supports JavaScript for forms and that you have a backup copy of your document before testing or modifying form scripts.

Solution 1Recommended

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.

1
Access Checkbox Properties

Open your PDF in form editing mode, right-click the trigger checkbox that will duplicate the fields, and select Properties.

2
Add a JavaScript Action

Navigate to the Actions tab. Select 'Mouse Up' as the trigger, choose 'Run a JavaScript' from the action list, and click Add.

3
Input the JavaScript Code

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; }`

4
Copy the Text Fields

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 currentValueIndices to Preserve Drop-Down Items
Optimization Tip: Place all of your field assignments inside a single curly brace block `{}` under the checkbox condition. There is no need to repeat the `if` condition for every individual field.
Powerful PDF Editor

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. 1. Open PDF Document: Launch WPS Office and open your interactive PDF file.
  2. 2. Access Form Tools: Navigate to the 'Form' or 'Fill & Sign' tab to access interactive field tools.
  3. 3. Interact with Fields: Click on any text field, checkbox, or drop-down menu to input your data or trigger embedded scripts.
  4. 4. Save the Document: Once your fields are filled, click the Save icon to preserve your data locally or to the cloud.
Easily fill text fields, checkboxes, and interactive drop-down menus.Highly compatible with standard Adobe Acrobat PDF forms and structures.Lightweight software with an intuitive interface for quick document processing.Cross-platform support to manage PDFs on Windows, Mac, iOS, and Android.
QA img-9

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.