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

Javascript to send e-mail using fields within form

New Here ,
Aug 21, 2013 Aug 21, 2013

Copy link to clipboard

Copied

I am trying to write a javascript that will send an e-mail when a checkbox is checked that will include certain fields from the form within the body of the e-mail.  Is this possible?

TOPICS
PDF forms

Views

40.3K

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
LEGEND ,
Aug 21, 2013 Aug 21, 2013

Copy link to clipboard

Copied

Votes

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 ,
Aug 21, 2013 Aug 21, 2013

Copy link to clipboard

Copied

I have tried refering to the tutorial that you mentioned but I am not familar with javascript at all.  When I copied and pasted the codes...nothing happens so I'm not sure what I am doing wrong.

Votes

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
Guest
Aug 21, 2013 Aug 21, 2013

Copy link to clipboard

Copied

Yuki,

You need to modify the script to suit your form.

What are the field names on your form that you want to include in the email?

Votes

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 ,
Aug 21, 2013 Aug 21, 2013

Copy link to clipboard

Copied

here is the code that I copied and used

// This is the form return e-mail. Its hardcoded

// so that the form is always returned to the same address

// Change address on your form

var cToAddr = "gleeherr@tuftsmedicalenter.org";

// Set the subject and body text for the e-mail message

var cSubLine = this.getField("generic name trade if applicable").value + this.getField("Strength").value + this.getField("Dosage Form").value;

// Send the form data as an PDF attachment on an e-mail

this.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr,

  cSubject: cSubLine, cMsg: cBody});

I want the subject field to Generic name trade if applicable + strength + dosage form

Also, is there a way for the e-mail to just automatically send without having the user to actually hit the send button in outlook?  When i distribute the form without the submit buttons, it automatically creates a submit button and when the end user hits the submit button, an e-mail automatically gets generated with the filled-in pdf attached and sent automatically to the owner of the form's e-mail.

Votes

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 ,
Aug 22, 2013 Aug 22, 2013

Copy link to clipboard

Copied

Also, is there a way for the e-mail to just automatically send without having the user to actually hit the send button in outlook?

Only if a special script is installed on the local machine of each user of the file.

Votes

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 Beginner ,
Sep 07, 2018 Sep 07, 2018

Copy link to clipboard

Copied

What would this script look like? I would love to see a sample for a system I'm working on.

Votes

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 07, 2018 Sep 07, 2018

Copy link to clipboard

Copied

A better approach is to submit the data to a web-server. At any rate, due to security reasons, it won't be completely automatic. The user will have to approve sending the data, at least once.

Votes

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 Beginner ,
Sep 07, 2018 Sep 07, 2018

Copy link to clipboard

Copied

I'm having trouble submitting the data to a web-server. I put the url of a directory on our website to hold the results of the submit (www.lsefspartans/public_html/wp-content/uploads/).

When I press submit I get the message:

This document is trying to connect to:

file:///c|/users/mona_/documents/web%20development/grants/www.lsefspartans/public_html/wp-content/uploads/

Which doesn't exist. It's appending the directory that I downloaded the pdf to with the URL I put in the submit button.

I therefore get the message: Error opening URL to submit this form.

Any ideas? Thanks in advance!

Votes

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
LEGEND ,
Sep 07, 2018 Sep 07, 2018

Copy link to clipboard

Copied

monab1  wrote

I'm having trouble submitting the data to a web-server. I put the url of a directory on our website to hold the results of the submit (www.lsefspartans/public_html/wp-content/uploads/).

That's now how it works. Your server has to be set up with a program that's designed to properly respond to a submitted form. There are all sorts of technical details that I'm not going to get into, but it's not as simple as you've assumed.

Votes

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 Beginner ,
Sep 07, 2018 Sep 07, 2018

Copy link to clipboard

Copied

Do you know where I can find documentation/instructions on how to write that program? Thanks

Votes

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
LEGEND ,
Sep 07, 2018 Sep 07, 2018

Copy link to clipboard

Copied

The following discusses the basics: Sending form data - Learn web development | MDN

Votes

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 ,
Oct 11, 2021 Oct 11, 2021

Copy link to clipboard

Copied

Hello,

 

Can you help me write a java script?  I have an Adobe sign form with an email field set as a required field that will be sent out via email. I want to ensure that a complete email address is provided when the form is completed. Can you help with this?

 

Votes

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 ,
Oct 11, 2021 Oct 11, 2021

Copy link to clipboard

Copied

This is not possible in an Adobe Sign form.

Votes

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 ,
Oct 11, 2021 Oct 11, 2021

Copy link to clipboard

Copied

LATEST

Thank you.

Votes

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 ,
Jan 12, 2020 Jan 12, 2020

Copy link to clipboard

Copied

Can anyone help me doing this work for mobile? As my script is working fine on PC but not submitting the form on Andriod device. What can add to my script to make it work for mobile too?

Votes

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 ,
Jan 14, 2020 Jan 14, 2020

Copy link to clipboard

Copied

Mobile viewer don't support the same level of JavaScript. So you can't. 

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

Votes

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 ,
Jan 15, 2020 Jan 15, 2020

Copy link to clipboard

Copied

Any alternate way of doing this on mobile??

Votes

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 ,
Jan 15, 2020 Jan 15, 2020

Copy link to clipboard

Copied

Any alternate way of doing this?

Votes

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 ,
Jan 15, 2020 Jan 15, 2020

Copy link to clipboard

Copied

A script is the only way.

Votes

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 ,
Mar 26, 2019 Mar 26, 2019

Copy link to clipboard

Copied

Ok, I have this work along time ago. Doing new fun projects now.

So How do I email only one of the pages of the PDF without extracting the one page?

//this.Page# ({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});

Votes

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 ,
Mar 27, 2019 Mar 27, 2019

Copy link to clipboard

Copied

Not possible. You have to either extract the page you want to send or delete the pages you don't want to send.

Votes

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