Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


PDF: How to email selected recipient based on combo box value

Posted on 2012-09-10
Medium Priority
Last Modified: 2012-09-11
Dear Experts,

I am trying to figure out a way to email the attached form to a different instructor based on the course selected in the course dropdown field. Right now I am using the mouse up event on the Email button to send to a URL (mailto:recipient....)  This method, however, forces me to create several different forms all with a different mailto address for the instructor regardless of what is selected in the dropdown.

To save a great deal of time, I am wondering if there is any javascript I could run that would check the value in the dropdown and based on that value send an email to the appropriate instructor for that course - some sort an array in javascript or....

Any help would be most appreciated.
Question by:shogun5
  • 2
  • 2
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 38388104
You can use JavaScript. Take a look at the JavaScript API document here:

There is a method to submit a form: Doc.submitForm()

Have you done anything with JavaScript and Acrobat yet? Here is the outline of what you need to do: Create a submit button that executes a JavaScript. Create a JavaScript program that gets the selected course and then selects an email, and as the last step submits the form to the selected email address. Take a look at the attached code:

// get the course name
var course = this.getField("course").value;
console.println("course: = " + course);

var email = "";

if (course == "          - Select a Course -")
   app.alert("You need to select a course first");
else if (course == "Hands-On Science")
    email = "bob@example.com";
else if (course == "6 Traits – Strategies, Assessments and Rubrics – K-6")
    email = "judy@example.com";
    email = "admin@example.com";

if (email != "")
    this.submitForm("mailto:" + email);

Open in new window


Author Comment

ID: 38389317
This works but when I submit the form now the attached form is fdf and not pdf. What can I do to ensure the entire pdf form is sent in the attachment.

Normally I select Submit Form as the action and ensure the entire PDF is checked. See screenshot.

LVL 44

Accepted Solution

Karl Heinz Kremer earned 2000 total points
ID: 38389337
Take a look at the documentation for the submitForm() method - the cSubmitAs parameter lets you select in which form the data will get submitted.

You would use something like this:

            cURL: "mailto:themail@address.com",
            cSubmitAs: "PDF"

Author Closing Comment

ID: 38389346
Right! That did it! Thanks!

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is in response to a question here (http://www.experts-exchange.com/Other/URLs/Q_28283850.html) at Experts Exchange. The Original Poster has a scanned signature and wants to make the background transparent so that the signature may be pl…
In a previous article published here at Experts Exchange, Signature Image with Transparent Background (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_12380-Signature-Image-with-Transparent-Background.html), I explained how to cre…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Suggested Courses

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question