These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Customize button with submit form function

scramer
Registered: Nov 6 2008
Posts: 7

I have a button created and the action of it is to submit a form. I want it to email two different staff members (which I have working) but also want it to to send the email to an email address that is located in a textbox on the form. Is this possible?

My Product Information:
Acrobat Pro 9.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Do you want to email the entire document, or just the form data? Does it need to work with Reader? How is the submit form action currently set up?

George
scramer
Registered: Nov 6 2008
Posts: 7
I want to email the entire document, including any info that has been typed in as a pdf attachment. Yes it needs to work with reader. Originally I created a button and the for the action did a submit form. I am now messing with java script and it will send a fdf attachment to two of the users (scramer and ttaylor but not reedb) but I haven't done anything with trying to pull the email from the text box. This is my first time doing this. Here is the code I currently have.

this.submitForm("mailto:scramer [at] central [dot] com [dot] com?" + "&cc=reedb [at] central [dot] com&cc=central [at] cusd3 [dot] com"
+ "&subject=Form 603"
+ "&body=Please Review"
);
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Use the mailDoc method instead. You have much better control over specifying recipients, subject, and message body contents.

In order for it to work with Reader, the document has to be Reader-enabled. If you enable the document using Acrobat Pro (as opposed to LiveCycle Reader Extensions), you need to be aware of the licensing restrictions. In short, if you deploy the form to more than 500 recipients, you may only use information from no more than 500 returned forms (including hardcopies). If fewer than 500 recipients, you can use information from an unlimited number of returned forms.

George
scramer
Registered: Nov 6 2008
Posts: 7
This is what I now have and it works perfectly. Accept I want to add a subject line and I want to CC it to, two other emails.

var f = this.getField("email");

this.mailDoc(true, event.mailto = f.value, "", "", "", "Attached is a copy of the signed Inservice Request Form. If aproved please remember to fill out a Payment Order for any costs you will have.")
scramer
Registered: Nov 6 2008
Posts: 7
Nevermind I got it. Thanks for your help.
vcurran26
Registered: Nov 6 2008
Posts: 31
Sorry to reopen a thread . . .
I am programming a submit button to send the form to an address form a field in the form and copy it the form to two addresses within the scripting. I have been told to use this really long line:

event.target.submitForm({cURL:"mailto:" + Totals.Table2.Row3.Authemail.rawValue + ";" + Totals.Table2.Row2.Origemail.rawValue + "?bcc=vcurran&subject=Purchase Requisition&body=Test",cSubmitAs:"PDF",cCharset:"utf-8"});I added some test addresses and split it up into:
event.target.submitForm(
{cURL:"mailto:" + Totals.Table2.Row3.Authemail.rawValue;
+ "jpughes [at] x [dot] com;dsisneros [at] x [dot] com"
+ Totals.Table2.Row2.Origemail.rawValue
+ "?bcc=vcurran&subject=Purchase Requisition&body=Test",
cSubmitAs:"PDF",cCharset:"utf-8"});

Of course it doesn't work for me. It should be in Java.
Did I split it into separate lines correctly?
Thanks, VC
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
It appears you need to keep your semicolon address seperator within the quoted string.

George Kaiser

vcurran26
Registered: Nov 6 2008
Posts: 31
I assume you mean I should change to
+ "jpughes [at] x [dot] com";"dsisneros [at] x [dot] com"However, it didn't work. The Java console keeps giving me this message:
SyntaxError: missing } after property list

The open and close backets and parentheses look correct to me. What part is the property list?
Thanks, VC
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
No, you need to keep the semicolon within the quotes. By having it outside to quoted string, you are setting the end of a JavaScript code line and every thing following is a new line of JavaScript code.

event.target.submitForm({cURL:"mailto:" + Totals.Table2.Row3.Authemail.rawValue+ "; <span class="spamspan"><span class="u">jpughes</span> [at] <span class="d">x [dot] com</span></span>;<span class="spamspan"><span class="u">dsisneros</span> [at] <span class="d">x [dot] com</span></span>; "+ Totals.Table2.Row2.Origemail.rawValue+ "?bcc=vcurran&subject=Purchase Requisition&body=Test",cSubmitAs:"PDF",cCharset:"utf-8"});

George Kaiser