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
}
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