Skip to main content
Crooosh
Participant
September 19, 2018
Answered

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

  • September 19, 2018
  • 1 reply
  • 789 views

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@hotmail.com&subject=TEST",

    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

This topic has been closed for replies.
Correct answer Thom Parker

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.

1 reply

Thom Parker
Community Expert
Community Expert
September 19, 2018
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Crooosh
CroooshAuthor
Participant
September 19, 2018

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

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
September 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.

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