PDF Editing Issues

How to Add Catalog Items to a PDF Order Form Using Buttons

Huma Ashraf ChHuma Ashraf Ch Nov 5, 2026 868 views

Question details

The user wants to create a dynamic PDF order form where clicking 'Add' buttons beside catalog items populates an order list with item details like name, price, and product code.

How to Add Catalog Items to a PDF Order Form Using Buttons
Product
PDF
Device & OS
not provided
Scenario
Creating an interactive digital product catalog or order form.
Observed behavior
Requires customers to click 'Add' buttons to build an order list at the end of the PDF, dynamically capturing details to summarize the order.
Before you start

Before adding JavaScript to your PDF form, sketch out the form structure, decide how to handle duplicate items or quantities, and ensure you have designated text fields ready to receive the catalog item data.

Solution 1Recommended

Use Custom JavaScript to Create Dynamic 'Add' Buttons

Assign JavaScript actions to form buttons to capture item details and populate predefined order list fields.

Native PDF features do not include a built-in shopping cart function. To achieve this, you must rely on custom JavaScript that triggers when a user clicks the 'Add' button.

The script will need to retrieve the fixed data (product code, name, price) associated with that button and push it into the next available empty row in your order form fields.

1
Create the order list fields

Design the bottom of your PDF with empty text fields arranged in rows. Name them systematically, such as 'Row1_Name', 'Row1_Price', 'Row2_Name', etc.

2
Insert the 'Add' button

Navigate to your form editing tools, select the Button tool, and draw a button next to your first catalog item.

3
Access button properties

Right-click the newly created button and select 'Properties'. Go to the 'Actions' tab.

4
Add JavaScript action

Set the trigger to 'Mouse Up' and the action to 'Run a JavaScript'. Click 'Add'.

5
Write the script

Enter a script that assigns the item's details to variables, checks which 'RowX' fields are currently empty, and populates the first available row with the item's data. Click 'OK' to save.

Use Custom JavaScript to Create Dynamic 'Add' Buttons
Scripting Knowledge Required: This method requires a working knowledge of Adobe Acrobat JavaScript to properly handle variables, write loops for empty row detection, and manage total price calculations.
Create Interactive PDF Forms

Design Interactive PDF Forms with WPS PDF

WPS PDF provides a user-friendly interface to create, edit, and manage interactive PDF forms. Easily add text fields, checkboxes, and buttons to streamline your data collection without needing complex setups for standard layouts.

  1. 1. Open your document: Launch WPS Office and open your PDF catalog or form document.
  2. 2. Access Form tools: Navigate to the 'Form' tab on the top ribbon to view all available interactive elements.
  3. 3. Add form fields: Select 'Text Field' or 'Push Button' to place interactive components next to your catalog items.
  4. 4. Edit properties: Double-click the added field to customize its name, appearance, and basic actions to suit your order form's layout.
Easily insert text fields, checkboxes, and interactive form controls.Highly compatible with standard interactive PDF forms created in Adobe Acrobat.Lightweight application that loads fast and uses minimal system resources.Offers built-in tools for filling, signing, and managing PDF forms efficiently.
microsoft office alternative - wps office

Frequently Asked Questions

Do standard PDF forms support shopping cart functionality?

Native PDFs do not have built-in shopping carts. You must simulate this behavior using custom JavaScript attached to form buttons to move data into specific rows, calculate quantities, and compute totals.

Why isn't my PDF button updating the order list fields?

Ensure that your JavaScript accurately references the exact field names of your order list. Check for typos in the script and ensure the target text fields are set up to accept text inputs.

Can I calculate the total price automatically in a PDF form?

Yes. You can add a text field at the bottom of your order list, open its properties, go to the 'Calculate' tab, and set it to sum the values of the individual price fields in your order rows.

Will JavaScript in PDFs work on mobile devices?

Many mobile PDF readers have limited or no support for complex JavaScript. For mobile users, it is often better to use a simple fillable form or a web-based form rather than a highly scripted PDF.