Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

eMail Submit button with mailto: based on form data

Avatar

04-02-2009

Based on form data, I would like to have an email button that sends mail to the email address identified in the email field. Obviously this can change, how would one go about programming a button to send to email based on field data?



Thx...



/cw

Replies

Avatar

Avatar
Validate 1
Level 10
Niall_O_Donovan
Level 10

Likes

646 likes

Total Posts

4,352 posts

Correct Reply

786 solutions
Top badges earned
Validate 1
Boost 500
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 1
Level 10
Niall_O_Donovan
Level 10

Likes

646 likes

Total Posts

4,352 posts

Correct Reply

786 solutions
Top badges earned
Validate 1
Boost 500
Boost 50
Boost 5
Boost 3
View profile
Niall_O_Donovan
Level 10

05-02-2009

Hi Chris,



Yes this can be easily done. I gathered the following solutions from various threads and so I am not claiming any originality here...



Set up a textfield "Email", with a tooltip telling users to separate email addresses with a ";".



Next set up a regular button with the following Javascript in the click event:



var email = xfa.resolveNode("form1.#subform.Email").rawValue;

var subject = "Specify your subject line here"



event.target.submitForm({cURL:"mailto: "+ email +"?subject=" + subject +"&body=You can also input some standard text to appear in the body of the email.",cSubmitAs:"PDF",cCharset:"utf-8"});



You might want to put an if statement that if the "Email" textfield is blank/null that an app.alert comes up informing the user to input at least one email address.



We took it a stage further on one of our forms. We set up three checkboxes with people's names who are regularly sent the form (nod and cc1 and cc2) and then a textfield "additional" for additional addresses.



Each checkbox had an associated Textfield (EM1_email, cc1_email, and cc2_email) that were invisible. Each checkbox had similar Javascript in the mouse up event:



if (this.rawValue == 0) {

EM1_email.rawValue = null;

}

else {

EM1_email.rawValue = "someone@company.ie;";

}



Then we set up another invisible textfield (Email) which had the following Formcalc in the calculate event:



if (nod.rawValue == 0 & cc1.rawValue == 0 & cc2.rawValue == 0) then

$ = null

else

$ = Concat(EM1_email, cc1_email, cc2_email, additional)

endif



This basically pulled the email addresses from the ticked checkboxes and the additional user inputted email addresses into one text field. From there the regular button with the script above send the email. This speeded up the process for regular reciptents.



If you search the forum for topics such as cURL:"mailto: you should see lots of other examples.



Good luck,



Niall

Avatar

06-02-2009

Thank you - this worked out well. I was able to do what I needed.



/cw

Avatar

16-03-2009

Hey would you be able to post an example of the whole code for this type of email form. I am reasonably inexperienced with this type of stuff but have been asked to put an email form with recipient choices onto a clients page. Could you please help.



Thanks

Tim

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

16-03-2009

If you post your email I will send you a sample that shows how to modify the email address based on a dropdown selection.

Avatar

16-03-2009

Hey thanks for this Paul. My email address is tim.grigor@gmail.com



Thanks again

Tim

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

16-03-2009

Just sent it

Avatar

Avatar
Level 1
sbryner
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
sbryner
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
sbryner
Level 1

19-03-2009

Hi Paul,



Could you send me your example as well?

sbryner@swinomishcasino.com



I'm looking for something similar and new to acrobat javascripting.



thanks,

sky

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

20-03-2009

Just sent it

Avatar

26-03-2009

could you also send to me. i keep getting null.... thanks



Emtesenair@liberty.edu