Add a Confirmation Message Before Submitting an Acrobat PDF Form
Question details
The user wants to display a confirmation message with OK and Cancel options before a PDF form is submitted and sent via email.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Setting up a form Submit button to prevent accidental clicks by asking the user to confirm their action before executing the mailto email delivery.
- Observed behavior
- The current Submit button uses a direct mailto action which immediately initiates an email draft, lacking a confirmation step for the form filler.
Ensure you have access to the PDF form in editing mode. You will need to replace any existing 'Submit a Form' or 'mailto' actions on your button with a custom JavaScript snippet.
Use a JavaScript Action for the Submit Button
Replace the standard mailto link with a JavaScript alert that asks for user confirmation before executing the document mailing function.
To show a popup alert with OK and Cancel buttons, you must use Adobe Acrobat's built-in JavaScript functions. By using the app.alert method alongside this.mailDoc, you can pause the submission process and wait for the user's approval.
It is critical that you remove all other actions associated with the submit button, otherwise, the default actions will fire simultaneously with your script.
Open your PDF form in Edit mode. Right-click the Submit button you want to modify and select 'Properties'.
Navigate to the 'Actions' tab. Look at the 'Actions' list at the bottom and delete any existing 'Submit a form', 'Open a web link', or 'mailto' actions to ensure they do not conflict with the new script.
In the 'Select Action' dropdown menu, choose 'Run a JavaScript', and then click the 'Add' button to open the JavaScript Editor.
Paste the following code into the editor, customizing the email and message as needed: if (app.alert("Have you checked your form? Do you want to continue with the submission?", 2, 2) == 4) this.mailDoc({cTo: "recipient@example.com", cSubject: "Email subject", cMsg: "Email body"});
Click 'OK' to close the editor, then close the Properties window. Exit Edit mode and click the Submit button to test your new confirmation message.

Create and Manage PDF Forms Seamlessly with WPS Office
If you frequently work with interactive PDF forms, WPS Office provides comprehensive PDF editing tools. You can easily fill out forms, edit PDF text, and manage your documents effortlessly without needing expensive specialized software.
- 1. Open your PDF: Launch WPS Office and open your PDF form document.
- 2. Fill or Edit the Form: Navigate to the PDF Editor or Form tab to interact with text fields, checkboxes, and buttons.
- 3. Save and Share: Once completed, easily save your modifications and share the filled document via email directly from the WPS interface.

Frequently Asked Questions
Why does my PDF form send without showing the confirmation box?
You likely still have a default 'Submit a Form' or 'mailto' action attached to your button. You must remove all other actions in the button's 'Actions' properties so that only the 'Run a JavaScript' action remains.
How do I change the recipient email address in the JavaScript code?
In the provided script, locate the parameter that says cTo: "recipient@example.com". Simply replace recipient@example.com with the actual target email address where you want the form submitted.
Can I prevent the email from generating if required fields are missing?
Yes. If you mark specific text fields or checkboxes as 'Required' in their individual properties, Acrobat will automatically block the submission and prompt the user to fill them in before the JavaScript email action is executed.




