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

Help with setting email address on a button

Dracos
Registered: Apr 9 2008
Posts: 2

We would like to be able to set the email address on a button by grabbing data entered into a different field on the Form? Is there a way to do this?

Example on the form we have 123 entered as an ID in and form field and we would like to set the email button to 123 [at] na [dot] com on the post submit event.

Is this possible?

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, this is possible. The email address is an input to all the JavaScript functions that send email. Assuming that you are using an AcroForm, and NOT a LiveCycle form, add a script like this to your button

var emailDest = this.getField("email").value;
this.mailForm(emailDest);

If you are using a LiveCycle form it gets more difficult, but it's still possible.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script