0

Using Adobe Acrobat Pro I am filling out a form that will be used by a variety of people, each with their own team lead. I want people to be able to fill out the form, type in the email of their team lead, and then have a submit button that will submit the form to that email.

Does anyone know what javascript I need to write to accomplish this?

I tried the Submit form function of the adobe acrobat button, but it doesn't allow me to customize the Mailto: form.

Edit: I found Javascript that lets users fill in a text entry field that will then be the subject of the body once the users click the submit button. Can someone who is more savvy than I rework this so that the email address is the one based on the user's entry?

Where "MyTextField" is the earlier user text field for the subject:

var customSubject = this.getField("MyTextField").value;
var mailtoUrl = "mailto:studiosupport@qoppa.com?subject=" + customSubject;
this.submitForm({
 cURL: mailtoUrl, bPDF:true
});

I'm trying to learn a bit about code as I look through this. Why would this workaround not work?

var customSubject = Tomato;
var mailtoUrl = "mailto:this.getField("MyTextField").value?subject=" + customSubject;
this.submitForm({
 cURL: mailtoUrl, bPDF:true
});
  • 1
    It would be too many leads to make templates for each ones, especially as they would change fairly frequently. We don't have any corporate IT programmers that I am able to ask. – CptnMorgan Nov 03 '22 at 22:03
  • This looks great! But I can't see what JavaScript was used. I tried converting the XFA to pdf and it removed all of the associated actions on the file. – CptnMorgan Nov 04 '22 at 00:59
  • Thank you for your help :) I retried the code with var TextEntry1= this.getField("MyTextField").value; var customEmail = "mailto:TextEntry1"; var mailtoUrl = customEmail+"?subject="; this.submitForm({ cURL: mailtoUrl, bPDF:true }); and it worked, but then Outlook responded with Microsoft Outlook does not recognize "TextEntry1" so it looks like my email program won't connect with the code :( – CptnMorgan Nov 04 '22 at 03:40
  • 1
    I finally figured it out! Thank you so much for your help!!! For some reason yours and my code didnt work, but this did: var cToAddr = this.getField("CoopEmail").value; // First, get the client CC email address var cCCAddr = this.getField("ClientEmail").value; // Set the subject and body text for the email message var cSubLine = "Subject" var cBody = "Thank you for submitting your form.\n" + "Bye" this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody}); I have no idea what the difference was, but I would have given up if not for you! – CptnMorgan Nov 04 '22 at 04:06

0 Answers0