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

Posted on 2012-09-10
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
    LVL 44

    Expert Comment

    by:Karl Heinz Kremer
    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 = "";
    else if (course == "6 Traits – Strategies, Assessments and Rubrics – K-6")
        email = "";
        email = "";
    if (email != "")
        this.submitForm("mailto:" + email);

    Open in new window


    Author Comment

    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

    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: "",
                cSubmitAs: "PDF"

    Author Closing Comment

    Right! That did it! Thanks!

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Acrobat’s JavaScript is a great tool to extend the application, or to automate recurring tasks. There are several ways a JavaScript can be added to the application or a document (e.g. folder level scripts, validation scripts, event handling scripts,…
    This article focuses on how to remove password security from multiple PDF files by Adobe Acrobat program. Sometimes it is essential to access the stored data items and to print, edit as well as copy content from Portable Document Format files in abs…
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now