How to Access Duplicate PDF Form Fields with #0 and #1 Suffixes
Question details
The user needs to retrieve values from duplicate PDF form fields that automatically generate #0 and #1 suffixes in their names, preventing standard programmatic access.

- Product
- Device & OS
- not provided
- Scenario
- Using code (such as JavaScript) to extract data or interact with duplicated form widgets in a PDF document.
- Observed behavior
- Form fields append #0 and #1 to their names, causing programmatic access attempts that include the suffixed names to fail.
Ensure you have access to a PDF editor to inspect the form field properties and verify whether the duplicated fields are meant to share the same value or operate independently.
Retrieve the Shared Value Using the Base Field Name
Use this method when the duplicate fields are intended to mirror the exact same data across different parts of the PDF.
When form fields in a PDF are duplicated, they often share the same underlying field name but are visually represented as multiple widgets identified by #0, #1, and so on. Because they share a single data source, you cannot target the suffix directly via code.
Open your PDF in edit mode and check the field properties. Note the base name, ignoring the #0 or #1 suffix altogether.
In your PDF JavaScript console or external processing script, use the getField() method targeting only the base name.
Run a command such as this.getField("BaseFieldName").value; to successfully retrieve the shared value of the duplicated widgets.

Rename Fields to Make Them Unique
Apply this solution if the form fields with #0 and #1 suffixes actually need to hold different, independent values.
Easily Manage and Edit PDF Form Fields with WPS Office
WPS Office provides a comprehensive PDF toolkit that allows you to easily create, edit, rename, and manage PDF form fields. Avoid naming conflicts and ensure your data extraction works flawlessly with its intuitive form editing features.
- 1. Open the PDF in WPS Office: Launch WPS Office and open your PDF document containing the duplicate fields.
- 2. Enter Form Edit Mode: Navigate to the Form tab and select Edit Form to view all interactive fields and their current names.
- 3. Modify Field Properties: Right-click the problematic fields, select Properties, and uniquely rename them or verify their base names for your scripts.

Frequently Asked Questions
Why do PDF form fields automatically add a #0 or #1 to their names?
This happens when you copy and paste a form field or duplicate a page containing form fields. The PDF format treats them as multiple visual representations (widgets) of a single underlying data field, assigning suffixes to differentiate them visually while keeping their data linked.
Can I assign different values to fields that share the same base name?
No. Fields with the same base name (even with different # suffixes) are designed to mirror the exact same data. To hold different values, you must manually rename the fields in your PDF editor so they each have unique names.
Does WPS Office support editing PDF form field names?
Yes, WPS Office includes a built-in PDF editor where you can access form editing tools, inspect field properties, and easily rename duplicate fields to resolve scripting conflicts.




