Copy link to clipboard
Copied
Not too long ago, I posted a question here about submitting form fields in a PDF, without sending the whole PDF (there are two forms on this document and each has its own submit button.) I correctly guessed that the following method would be the only way:
-Use JavaScript to construct an email, and populate the body of the email using the form fields.
Finding the right commands wasn't too hard. This script works just fine:
this.submitForm(
"mailto:msanders2657@gmail.com?" +
"&subject=good news" + "&body=" +
"Name: " + this.getField("SellerFirstName").value + " " + this.getField("SellerLastName").value +
"\nEmail Address: " + this.getField("SellerEmail").value +
"\nPhone Number: " + this.getField("SellerPhone").value
);
This will construct an email with the body in this format:
Name: Jane Doe
Email Address: janedoe@example.com
Phone Number: (555)555-5555
However, the following updated script causes my Submit button to do nothing at all:
this.submitForm(
"mailto:msanders2657@gmail.com?" +
"&subject=good news" + "&body=" +
"Name: " + this.getField("SellerFirstName").value + " " + this.getField("SellerLastName").value +
"\nEmail Address: " + this.getField("SellerEmail").value +
"\nPhone Number: " + this.getField("SellerPhone").value +
"\nBest Time to Contact: " + this.getField("SellerContactTime").value
);
All I'm doing here is adding another one of the fields to be listed. There are about 20 fields total, but it seems like this script completely breaks if I attempt to send more than four. Can someone tell me what I'm doing wrong here?
Copy link to clipboard
Copied
See my reply to your other thread: https://community.adobe.com/t5/acrobat/submit-dropdown-value-using-submit-button-javascript/m-p/1163...