How to Use a Drop-Down Email List for a PDF Submit Button
Question details
The user wants to know if a PDF form can include a drop-down list of email addresses that dynamically sets the destination address for a Submit Form button.

- Product
- Device & OS
- not provided
- Scenario
- Creating an interactive PDF form where the submission routing changes based on the user's selection from a drop-down menu.
- Observed behavior
- The user needs a method to dynamically link a selected drop-down item to the submission action of a PDF form button.
Ensure you have a professional PDF editing tool capable of creating interactive forms and executing custom actions or JavaScript, such as Adobe Acrobat Pro or WPS Office.
Configure Dynamic Email Submission using JavaScript in PDF Properties
The most effective way to link a drop-down list to a submit button is by assigning export values to the drop-down items and executing a custom JavaScript action upon clicking the button.
To achieve a dynamic email submission, you must first configure your drop-down list to hold email addresses as hidden 'Export Values'. Afterward, you will apply a short JavaScript code to the Submit button that retrieves the selected export value and opens the user's default email client with the target address pre-filled.
Create a drop-down menu field in your PDF (e.g., name it 'DepartmentSelect'). In the field's 'Options' tab, add your visible choices (like 'Sales' or 'Support') and set the 'Export Value' of each choice to the corresponding email address.
Add a standard Button field to your PDF form and label it 'Submit' using the 'Options' tab.
Right-click your newly created Submit button, select 'Properties', and navigate to the 'Actions' tab.
Under 'Select Trigger', choose 'Mouse Up'. Under 'Select Action', choose 'Run a JavaScript', and then click 'Add'.
In the JavaScript Editor window, enter the code to fetch the email and trigger the mail action. Example: `var email = this.getField('DepartmentSelect').value; if (email) { this.mailDoc({cTo: email}); }`. Click 'OK' to save.

Create and Manage PDF Forms Easily with WPS Office
WPS Office provides a comprehensive PDF toolkit that allows you to effortlessly edit PDFs, fill out interactive forms, and manage document submissions securely. It simplifies form processing without needing complex coding knowledge.
- 1. Open your document: Launch WPS Office and open your PDF form document.
- 2. Access Form tools: Navigate to the 'Form' tab on the top ribbon to access interactive form field tools.
- 3. Edit form elements: Use the provided tools to add or modify text fields, drop-down menus, checkboxes, and buttons intuitively.
- 4. Save and distribute: Save your interactive PDF form and distribute it to your team or clients for hassle-free filling and submission.

Frequently Asked Questions
Can I hide the actual email addresses from the drop-down list view?
Yes, you can display a generic name like 'Customer Service' as the 'Item Name' in the drop-down menu's properties, while setting the actual email address as the 'Export Value'. The user will only see the generic name, but the form will submit to the hidden email address.
Why isn't my PDF Submit button working after adding the script?
If your submit button isn't functioning, verify that the JavaScript syntax is correct and that the field name referenced in the script perfectly matches the actual drop-down field name (capitalization matters). Additionally, ensure that your PDF viewer's security settings permit JavaScript execution.
Can I send the PDF form to multiple dynamic email addresses simultaneously?
Yes. In your JavaScript code, you can concatenate multiple email addresses separated by semicolons within the 'cTo', 'cCc', or 'cBcc' parameters of the mailDoc function, or use multiple field values to construct the final recipient list.




