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

dynamic email address based on pulldown value

EggsBenedict
Registered: Dec 11 2006
Posts: 4

I have a form with a submit by email button. I would like the value of the associated email address to change based on a value selected in a separate pulldown menu.
 
Do I set a variable at a "global" level based on the pulldown changing?
or
Do I use an if statement on the button click?
 
I am very green to Adobe, but comfortable with forms and javascript, but not having any luck with this.

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
To use a dynamic email address you'll need to use a JavaScript function, there are two:

doc.mailForm() and doc.submitForm()

The first one 'doc.mailForm()' does not work in Reader unless the form has Forms Rights enabling. If you want it to work in Reader use 'doc.submitForm()'. Look it up in the Acrobat JavaScript Reference and it is discussed in this article, [url=http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/submitting_data/] submitForm[/url]

On the form, set the export values of the list field entries to the actual emails, then you can use the list field value directly in the 'submitForm()' fucntion.

Thom Parker
WindJack Solutions
[url=http://www.windjack.com]www.windjack.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://partners.adobe.com/public/developer/en/acrobat/sdk/
pdf/javascript/AcroJS.pdf]Acrobat JavaScript Reference[/url]

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