Skip to main content
Participating Frequently
October 24, 2017
Answered

Display data from form in email

  • October 24, 2017
  • 1 reply
  • 1093 views

I have a form created many years ago by someone alot smarter than I.  They used Adobe Acrobat to make a form and added a button that used Java script to email the form to a group.  I have been able to get the script narrowed down to what I need other than I would like for it to add a field from the form, memberid, in the subject line of the email.  Right now the Java code it this:

// submit the form

if (bContinue) {

    var submitURL;

    if (app.viewerVersion < 9.0)

        submitURL = "mailto:djackson@*********.com?subject=Submitting Completed Form <memberid>&body=Instructions to add this form to a response file:\n1. Double-click the attachment.\n2. Acrobat will prompt you to select a response file.&ui=false";

    else

        submitURL = "mailto:djackson@*************.com?subject=Submitting%20Completed%20Form%20<memberid>&body=Instructions%20to%20add%20this%20form%20to%20a%20response%20file:%0A1.%20Double-click%20the%20attachment.%0A2.%20Acrobat%20will%20prompt%20you%20to%20select%20a%20response%20file.&ui=false";

    currentDoc.submitForm({

        cURL: submitURL,

        cSubmitAs: "PDF"

    });

}

All it is doing is putting <memberid> in the subject line, not the actual number from the memberid field in the form.  Any thoughts?  is this even possible?.

This topic has been closed for replies.
Correct answer try67

Sure is. Change the submitURL variable definition to:

submitURL = "mailto:djackson@*********.com?subject=Submitting Completed Form "+this.getField("memberid").valueAsString+"&body=Instructions to add this form to a response file:\n1. Double-click the attachment.\n2. Acrobat will prompt you to select a response file.&ui=false";

I think you have a mistake in it, though. The "&ui=false" part should not be a part of this string, it's a separate parameter.

Also, it won't work. You can't specify this parameter as false, unless the code is located in a doc-level script.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
October 24, 2017

Sure is. Change the submitURL variable definition to:

submitURL = "mailto:djackson@*********.com?subject=Submitting Completed Form "+this.getField("memberid").valueAsString+"&body=Instructions to add this form to a response file:\n1. Double-click the attachment.\n2. Acrobat will prompt you to select a response file.&ui=false";

I think you have a mistake in it, though. The "&ui=false" part should not be a part of this string, it's a separate parameter.

Also, it won't work. You can't specify this parameter as false, unless the code is located in a doc-level script.

try67
Community Expert
Community Expert
October 24, 2017

And the submitForm method doesn't even have such a parameter...