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

changing email variable with dropdown list

Navyopie
Registered: May 18 2010
Posts: 11
Answered

ok im a rookie, please dont kill me too much. I'm trying to change the email var based on the selection from a dropdown list. How do i have it search the array for name. should i use an array for this? I'm new to this so any help would be appreciated
 
Heres the code
 
var cToAddr =""
var tech = this.getField("Technician");
var designEmail ="diane [at] you [dot] com";
var productsEmail ="jamie [at] yahoo [dot] com";
var designTeam =["Jamie H","Russ C","Sue B"];
var productsTeam=["Alan E","Damian B"];
 
if (tech.value == designTeam){
cToAddr=designEmail
}
if (tech.value == procductsTeam){
cToAddr=productsEmail
}
 

My Product Information:
Acrobat Pro Extended 9.4, Macintosh
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Accepted Answer
Do you mean that if the value of Technician is either "Jamie H" or "Russ C" or "Sue B" then the email should be sent to the designEmail address (and the same with the Products team)?
If so, then you need to loop over the arrays, like so:


for (i in designTeam) {
if (cToAddr==designTeam[i]){
cToAddr=designEmail;
break;
}
}for (i in procductsTeam) {
if (cToAddr==procductsTeam[i]){
cToAddr=productsEmail;
break;
}
}

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Navyopie
Registered: May 18 2010
Posts: 11
thanks man, that helped me out