Expand my Community achievements bar.

SOLVED

Send PDF form to email address user enters in textfield on form.

Avatar

Level 9

I would like to be able to allow the person using the form to choose what email address the PDF form is emailed to. I read this post which sounds like what I want but I keep getting a Submit Cancelled error. The email does get generated and the form is attached as a PDF so that part works okay.

http://forums.adobe.com/message/4167414#4167414

This is the code I am using as I only need the To: address populated.

form1.Page1.Button1::preSubmit:form - (JavaScript, client)

var strToAddress

//Capture the values from the form fields.
strToAddress = txtToAddress.rawValue;

event.target.submitForm({cURL:"mailto:"+ strToAddress,cSubmitAs:"PDF",cCharset:"utf-8"});

 

1 Accepted Solution

Avatar

Correct answer by
Level 10
4 Replies

Avatar

Level 10

Hi,

There is an example here: http://assure.ly/eUR4wJ.


// Declare the variable

var vEmail;

// Check that the email field is not null

if (txtToAddress.rawValue !== null) {

     vEmail = txtToAddress.rawValue;

}

// Send email

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

Niall

Avatar

Level 9

The script you included goes in the Click Event?

Thanks Niall

Avatar

Correct answer by
Level 10

That's correct!

Avatar

Level 9

Works great! Thanks so much for your help!

-Don