Expand my Community achievements bar.

SOLVED

How do I use a generic button to submit xml instead of pdf?

Avatar

Level 2

Hello All.

I am using the following javascript that I found to email a form:

var subject = form1.SF1.TxtFld1.rawValue.concat(_form1.SF1.TxtFld2.rawValue);

var myDoc = event.target;

try {

    myDoc.mailDoc({

        bUI: false,

        cTo: 'myEmail@email.com',

        cSubject: subject,

        cSubmitAs: "XML"

    });

} catch (e) {

    // exception handling...

}

I would like to modify the above to email the xml instead of the pdf.  Can anybody help? 

The reason I'm not using the submit button is because I can't figure out how to customize the subject line as I have in the above script. 

If there's a better way of doing what I need, please let me know - I'm open to suggestions.

Thanks,

J


1 Accepted Solution

Avatar

Correct answer by
Level 2

I had a typo in the code. Try this:

event.target.submitForm({cURL:"mailto:"+""+"?&body="+"This is a test email"+"&subject="+subject+"", cSubmitAs:"PDF",cCharset:"utf-8"});

View solution in original post

4 Replies

Avatar

Level 1

Add a regular button to the form.

Add/Modify the following script on the click event of the button:

event.target.submitForm({cURL:"mailto:"+"email@address.com"+"?&body="This is a test email "&subject="+ subject +", cSubmitAs:"PDF",cCharset:"utf-8"});

You will need an Adobe LiveCycle Reader Extensions Server to make this possible for users who only have Reader and not full Acrobat.

Please see the following thread for more information: http://forums.adobe.com/thread/286054

Avatar

Level 2

Thanks for the reply.  I'm not able to get the above to work properly, I keep getting an error that states that it is expecting a { on line one.

Any ideas about what I'm doing incorrectly?

Avatar

Correct answer by
Level 2

I had a typo in the code. Try this:

event.target.submitForm({cURL:"mailto:"+""+"?&body="+"This is a test email"+"&subject="+subject+"", cSubmitAs:"PDF",cCharset:"utf-8"});