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

How to let the user fill in the email address

vakathy
Registered: May 1 2007
Posts: 2

Hi:

I'm new at this. I need to use a "submit by email button" but I want the user to be able to either add the email address (because it will always be different) or, let the users email client load, let them put in the email address and send the form to where it needs to go. Thanks for your help. Kathy

Terrill
Registered: May 4 2007
Posts: 14
Kathy,

Actually, the answer you seek is already in the JavaScript Corner on this site. [url=http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/submitting_data/]Click Here[/url] to read the original article by Thom Parker.

Assuming you had a Text Field named txtEmailTo and a submit button named cmdSubmit, then in the Mouse Up() event for cmdSubmit you would add the following JavaScript code (stolen directly from Thom's column, and modified):

this.submitForm("mailto:" + this.getField("txtEmailTo").value + "?"+ "&cc=<span class="spamspan"><span class="u">gg</span> [at] <span class="d">mycom [dot] com</span></span>&bcc=<span class="spamspan"><span class="u">john</span> [at] <span class="d">mycom [dot] com</span></span>"+ "&subject=good news"+ "&body=The order is in!");

In Adobe Reader, clicking cmdSubmit will bring-up the user's email client, and in the example above, the "To:", "Cc:", "Subject:" fields will be filled. The "From:" will be the user's normal email address. And the "Body" will say "The order is in!"

The user can then modify any of the above to fit their needs.

Hope this helps?!

-- Terrill --
"90% of the battle is knowing if it can or cannot be done. 9% of the battle is finding someone else's code that comes close. 1% of the battle is modifying the code to do what you need, and taking credit!"