I am using LiveCycle 8.0, today is my second day at it and I am using the following javascript on a regular button so that when a user fills out a form it auto e-mail me and adds the info to the body in plain txt.
----- form1.#subform[0].Email::click: - (JavaScript, client) ---------------------------------------
event.target.submitForm({cURL:"mailto:me [at] myemail [dot] com?subject="+ID1.rawValue+"'s Hareware Move&body=Do not change subject line or body of this email. User Info: NMCI User ID: "+ID1.rawValue+" Phone: "+phone1.rawValue+" Computer Info: Asset: "+Asset.rawValue+" Computer Name: "+Compname.rawValue+" Current Location: Bldg: "+Bldg1.rawValue+" Floor: "+Floor1.rawValue+" Room: "+Room1.rawValue+" Network plug "+Plug1.rawValue+" New Location: Bldg: "+Bldg2.rawValue+" Floor: "+Floor2.rawValue+" Room: "+Room2.rawValue+" Network Plug: "+Plug2.rawValue+" Comments: "+Comments.rawValue+"",cSubmitAs:"PDF",cCharset:"utf-8"});
This works well, but I would like to edit the body, Because I will get an e-mail with no formating
===============
Body:
Do not change subject line or body of this email. User Info: NMCI User ID: null Phone: null Computer Info: Asset: null Computer Name: null Current Location: Bldg: null Floor: null Room: null Network plug null New Location: Bldg: null Floor: null Room: null Network Plug: null Comments: null
What do I need to do to be able to format the e-mail body so it will look like:
===============
Body:
Do not change subject line or body of this email.
User Info:
NMCI User ID: null
Phone: null
Computer Info:
Asset: null
Computer Name: null
Current Location:
Bldg: null
Floor: null
Room: null
Network plug null
New Location:
Bldg: null
Floor: null
Room: null
Network Plug: null
Comments: null
Thanks in advance
*edit to give better example
Start off by defining the body text in a separate variable. Then use the JavaScript "encodeURI" function to URL encode it for transmission. Like this
var myBodyText = "Hello\nWorld";
event.target.submitForm({cURL:"mailto:me [at] myemail [dot] com?body=" + encodeURI(myBodyText) + "&subject=" + ID1.rawValue, ... });
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script