Avatar

Level 3

Hello,

There are two text fields (employee and team). I want team to autopopulate based on employee using an array (I think this is the best way).

textfieldA has 1 email in it (of 60 possible). I want textfieldB to autopopulate with another email (of 5 possible) based on the rawValue of textfieldA.

My code is on a change event and looks like this (and does not work):


var x;

var 3dClos = new Array("first.last@domain.com","firs.las@domain.com","fir.la@domain.com");

if(email.rawValue = 3dClos[x]) {

    supemail.rawValue = "correct.email@domain.com";
    }
    else
    {
    supemail.rawValue = "";

I do not want to make a giant if else statement as I have in the past - this is the perfect opportunity to learn the smart way to do it (even if it is not using an array). So in closing - check an email, see if it belongs to a tema and display that team email in another field.

Can anybody help?