How to Create a PDF Order Form with Conditional Email Recipients
Question details
The user needs to build a dynamic PDF order form where selecting certain checkboxes automatically assigns specific email addresses as the recipients for the form submission.

- Product
- Device & OS
- not provided
- Scenario
- Setting up a dynamic PDF form with conditional logic to route submitted data to different email addresses based on user selections.
- Observed behavior
- The form must evaluate checkbox inputs, compile a recipient list, and transmit the required fields to the dynamically generated email addresses.
Ensure you are using a professional PDF editor that supports JavaScript execution and interactive form field configuration.
Configure Dynamic Emails using JavaScript and the submitForm Method
Apply a custom JavaScript action to the form's submit button to dynamically calculate the destination email address based on which checkboxes are selected.
To achieve dynamic email routing in a PDF form, standard submit actions are not enough. You must use JavaScript to check the status of specific fields (like checkboxes) and construct the target 'mailto:' string before calling the submission method.
Open your PDF form in edit mode. Ensure that your checkboxes and required input fields have unique, identifiable names (e.g., 'DepartmentA_Checkbox').
Right-click the 'Submit' button on your form, select 'Properties', and navigate to the 'Actions' tab.
From the 'Select Action' dropdown menu, choose 'Run a JavaScript' and click 'Add'.
In the JavaScript editor, write a script to evaluate the checkboxes. For example: define a variable, check if 'this.getField("Checkbox1").value !== "Off"', and append the corresponding email address to your variable.
At the end of your script, call the submit method using your dynamic email string: this.submitForm({cURL: 'mailto:' + dynamicEmailString, cSubmitAs: 'PDF'});
Create and Manage Interactive PDF Forms with WPS Office
WPS Office provides a comprehensive PDF editor that allows you to easily design interactive forms, insert checkboxes, add push buttons, and manage document properties without requiring expensive alternative software.
- 1. Open WPS PDF: Launch WPS Office and open your document using the PDF editor.
- 2. Access the Form tools: Click on the 'Form' tab in the top navigation ribbon to reveal form building options.
- 3. Insert form controls: Select 'Check Box' or 'Push Button' and draw the field directly onto your document layout.
- 4. Configure field properties: Double-click the newly inserted field to access its properties, name the field, and set up export values or actions.

Frequently Asked Questions
Why is my PDF form not sending the email when the button is clicked?
This usually occurs if the end-user is opening the PDF in a web browser or a basic PDF reader that does not support JavaScript. It can also happen if their device does not have a default desktop email client (like Outlook or Apple Mail) configured to handle 'mailto:' links.
Can I specify which exact form fields are sent in the email?
Yes. When using the JavaScript submitForm method, you can use the 'aFields' parameter to pass an array of specific field names. Only the data from the fields defined in this array will be included in the submission.
Do dynamic JavaScript PDF forms work on mobile devices?
Generally, no. Most mobile PDF viewers (on iOS and Android) have limited or no support for advanced JavaScript execution such as conditional email routing. It is highly recommended that users fill out these complex forms on a desktop computer.




