How to Email Selected PDF Form Data Without Submitting the Entire Form
Question details
The user needs to create an email from a fillable PDF form that includes only specific field values in the message body, rather than attaching the entire PDF or submitting all form data.

- Product
- PDF Form Editors
- Device & OS
- not provided
- Scenario
- A user wants to selectively extract data from a completed PDF form and send just that text data via email to a client or recipient.
- Observed behavior
- Standard form submission buttons typically send the entire document or a complete data file. A custom solution is required to filter the data and format it into a plain email body.
Ensure you know the exact field names in your PDF form that you want to extract, and verify that your PDF editing software supports custom JavaScript actions for form buttons.
Create a Custom JavaScript Email Workflow
Use a custom JavaScript action attached to a form button to collect specific field values and construct an email message body dynamically.
By default, standard submit buttons send the whole PDF or all form data. To send only specific fields without attaching the file, you can write a short JavaScript snippet that reads the selected fields, builds a text string, and triggers the user's default email client using the app.mailMsg() method.
Open your PDF form in edit mode, navigate to the interactive form tools, and add a standard 'Button' to the page.
Right-click the newly created button and select 'Properties'. Go to the 'Actions' tab.
Under 'Select Action', choose 'Run a JavaScript' from the dropdown menu, and click 'Add'.
In the JavaScript editor, define variables to extract your specific fields. For example: var name = this.getField('ClientName').value; var amount = this.getField('TotalAmount').value;
Below your variables, add the mail trigger: app.mailMsg({bUI: true, cTo: 'client@example.com', cSubject: 'Form Data', cMsg: 'Name: ' + name + '\nAmount: ' + amount}); Click OK to save.

Create and Manage Interactive PDF Forms with WPS Office
WPS Office provides a comprehensive suite of PDF tools that make it easy to create, edit, fill, and manage interactive PDF forms without requiring heavy or expensive software.
- 1. Open WPS PDF: Launch WPS Office and open your PDF document using the built-in PDF editor.
- 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to view all interactive form controls.
- 3. Edit or Fill Fields: Click on any form field to fill out data, or use the editing tools to add new buttons and text fields.
- 4. Save and Share: Save your completed form or share it directly via email from within the WPS interface.

Frequently Asked Questions
Why doesn't the email open when I click the custom button?
This usually happens if you do not have a default desktop email client configured on your computer, or if your PDF viewer's security settings are blocking JavaScript execution. Check your system's default apps settings.
Can I format the extracted text in the email body?
Yes, you can use standard JavaScript string manipulation, including adding line breaks (\n) and combining text with field values, to format the message body exactly as you need.
Is it possible to attach the PDF using this JavaScript method?
Yes, if you decide you want to attach the document later, you can use the mailDoc() method instead of mailMsg(), though mailDoc() does not allow you to populate the email body text dynamically.




