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

XML code

catmc
Registered: Apr 5 2010
Posts: 16

Hi
I'm wondering if someone can help me with writing the XML code for two submit buttons (Approve and Decline) which will attach the adobe form via email and automatically insert two fields into the subject line of the email
(two fields are Position Name and Approve or Disapprove)
Any ideas??
Thanks
Cat

This is the current code - if that helps

- Employee Change Form - Version 16 March 2010

<?templateDesigner isEmailSubmitObject true?>

Submit Approval by Email

<?templateDesigner StyleID apbx2?>

$data.form1

//{{Adobe LiveCycle Designer Generated Code Begin}} - sign data target version check script. Do NOT modify!&#xD;
if (xfa.host.name=="Acrobat"){&#xD;
if (app.viewerVersion < 8)&#xD;
{&#xD;
this.access = "readOnly";&#xD;
}&#xD;
else&#xD;
{&#xD;
this.access = "open";&#xD;
}&#xD;
}&#xD;
//{{Adobe LiveCycle Designer Generated Code End}} - sign data target version script.

<?templateDesigner isEmailSubmitObject true?>

Submit Decline by Email

<?templateDesigner StyleID apbx2?>

$data.form1

//{{Adobe LiveCycle Designer Generated Code Begin}} - sign data target version check script. Do NOT modify!&#xD;
if (xfa.host.name=="Acrobat"){&#xD;
if (app.viewerVersion < 8)&#xD;
{&#xD;
this.access = "readOnly";&#xD;
}&#xD;
else&#xD;
{&#xD;
this.access = "open";&#xD;
}&#xD;
}&#xD;
//{{Adobe LiveCycle Designer Generated Code End}} - sign data target version script.

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
So why exactly are you writing code to generate this XML? Why not just create the form in Designer? Please explain your workflow.

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

catmc
Registered: Apr 5 2010
Posts: 16
As I need to instruct it to select the text entered into the two fields and insert it into the subject of the email, and can't seem to work out how to do it in designer.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There are two different methodologies for doing this.

One method is outlined here, and there is a LiveCycle form sample:
http://www.acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address

The other method is to use JavaScript to modify the attributes of the submit action. If you can wait a week there will be an article on exactly this topic posted in the tutorials. Otherwise, you'll find several forum topics that touch on this point here, and Stephan Cameron has written about it on his blog:
http://forms.stefcameron.com/2008/08/28/submitting-form-data-by-email/

You'll find gobs of usful information in this blog. Stephan is a magician.

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

catmc
Registered: Apr 5 2010
Posts: 16
Great. thanks so much Thom.