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

Digital signature that submit forms with JavaScript

Annelie
Registered: Mar 20 2010
Posts: 3
Answered

Hello, I'm a new user of both acrobat pro, JavaScript and this forum and I need help.

I have some problem with an action of a digital signature in a form. I will have this scenario. When a special person set their own digital signature on this form, would the sender of this form received a signed copy and one copy would be sent to xxxxxx [at] xxxxxxxxx [dot] se
I have tried with javascipt, but it isn’t my strong side. I’m a newbie so it doesn’t work
// This is the form return e-mail. Its hardcoded
// so that the form is always returned to the same address
// Change address on your form
var cToAddr = "xxxxxxx [at] xxxxxxxxxxx [dot] se";
// Now get the beneficiary e-mail only if it is filled out
var cBenAddr = this.getField("E-mail_Personal").value;
if(cBenAddr != "")
cCCAddr += ";" + cBenAddr;
// Set the subject and body text for the e-mail message
var cSubLine = "Form X-1 returned from client";
var cBody = "Thank you for submitting your form.\n" +
"Save the mail attachment for your own records";
// Send the form data as an FDF attachment on an e-mail
event.target.mailForm({bUI: true, cTo: cToAddr, cCc: cCCAddr,
cSubject: cSubLine, cMsg: cBody});

My Product Information:
Acrobat Pro Extended 9.3.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Your code looks good except that it mixes LiveCycle and AcroForm syntax. If this is a LiveCycle form the "this.getField" function will not work. You'll need to change this to use LiveCycle syntax.

Something like this, but change it to match the hierarchy in your form:
var cBenAddr = form1.Page1.PersonalInfo.E-mail_Personal.rawValue;

Watch this video:
https://admin.adobe.acrobat.com/_a200985228/p87746471/

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Annelie
Registered: Mar 20 2010
Posts: 3
Thanks for your answer, Thom.

I used your tutorials, so it must look good. lol. But I missed to read all text in it. I'm working in Adobe Pro Extended and not in LiveCycle. Now it works fine!