• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Adding form data into subject & body - submit form - JavaScript

New Here ,
Sep 18, 2018 Sep 18, 2018

Copy link to clipboard

Copied

Hi All,

Bit of a noob when it comes to JavaScript so any help for dummies would be greatly appreciated.

I'm trying to configure my email submit button on a form.

Current Script I have is:

this.submitForm({
cURL: "mailto:email1@hotmail.com?&cc=email2@hotmail.com;email3@hotmail.com;email4@hotmail.com;email5@hotmai...",

    cSubmitAs: "PDF"
});

I have to be able to add form fields (hospital & commencement are the field names) into the subject and also potentially the Body as well as some hardcoded text.

Is there an easy was to configure this using that script?

Thanks,
Chris

TOPICS
Acrobat SDK and JavaScript , Windows

Views

250

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 19, 2018 Sep 19, 2018

Please try copying the code provided in the article and modifying it for you own purpose. Note the structure of the code. Each piece of the email URL (to, cc, body and subject) is created individually from fields on the form, then concatonated into the URL string. For your purpose, remove the bits you are not using.

If you run into a problem, then post the code and an explanation of the problem here so we can help you with the specific issue.

Likes

Translate

Translate
Community Expert ,
Sep 18, 2018 Sep 18, 2018

Copy link to clipboard

Copied

Here's an article on exactly this topic:

https://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 18, 2018 Sep 18, 2018

Copy link to clipboard

Copied

I did read that, but maybe since I'm not a coder by title I got a little confused, will have another look.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 19, 2018 Sep 19, 2018

Copy link to clipboard

Copied

LATEST

Please try copying the code provided in the article and modifying it for you own purpose. Note the structure of the code. Each piece of the email URL (to, cc, body and subject) is created individually from fields on the form, then concatonated into the URL string. For your purpose, remove the bits you are not using.

If you run into a problem, then post the code and an explanation of the problem here so we can help you with the specific issue.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines