Populate Email Recipients from an Acrobat Form Submit Button
Question details
The user needs an Acrobat form button to populate email recipients based on a dropdown selection and attach the PDF.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A PDF form uses a dropdown to determine who should receive the form by email.
- Observed behavior
- The form opens an email with the PDF attached, but the To field is empty.
Check the exact dropdown field name and its option values in Acrobat's Prepare a Form tool. Confirm that Acrobat JavaScript is enabled and that a desktop email client is configured.
Use one JavaScript action to select recipients and email the PDF
Use this approach when the button must choose recipients based on a dropdown and attach the current PDF.
The example uses a dropdown named ApprovalStatus with values Approved and Rejected. Replace the field name, values, and example email addresses with those used in your form.
In desktop Acrobat, open the PDF, select Prepare a Form, and double-click the submit button to open its properties.
On the Actions tab, select the Mouse Up trigger. Remove any separate Submit a Form action that uses a mailto address, then select Run a JavaScript and click Add.
In the JavaScript editor, enter the following script and replace the example values: var field = this.getField("ApprovalStatus"); if (!field) { app.alert("The ApprovalStatus field was not found."); } else { var recipients = ""; if (field.valueAsString === "Approved") { recipients = "approved@example.com"; } else if (field.valueAsString === "Rejected") { recipients = "review@example.com"; } if (recipients) { this.mailDoc({bUI: true, cTo: recipients, cSubject: "Completed form"}); } else { app.alert("Select a valid approval status before submitting."); } }
Close the button properties, save the PDF, and test each dropdown option in desktop Acrobat. Click the submit button and check the To field and PDF attachment in the email window.

Edit PDFs and Office files with WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office documents. It does not fix Acrobat's JavaScript or email integration, but it can help you manage everyday documents as you move between applications.

Frequently Asked Questions
Why does the email open with an empty To field?
Check that the JavaScript uses the exact dropdown field name and option values. In the button's Actions tab, remove any separate Submit a Form mailto action that could open another email or override the recipient data.
Where can I find the dropdown field name?
In Acrobat, open Prepare a Form and double-click the dropdown. Check its name in the field properties and use that exact name in this.getField().
How do I enable JavaScript in Acrobat?
Open Acrobat's Preferences, select JavaScript, and check that Acrobat JavaScript is enabled. Reopen the form and test the button in desktop Acrobat.
Can the button send the PDF to more than one person?
Yes. Set the script's recipients variable to the required addresses, separated by commas, before passing it to the cTo parameter in mailDoc.




