There are a couple of ways. I would use a drop down list with the unique employee names and their Employee ID as the export value. For ease of maintenance I would create a document level array of the names and IDs and then use that array to populate the drop down field.
So I would have a document level script:
var aNamesID = new Array(
[" ", ""],
["John Doe", "123"],
["Jane Doe", "456"],
["Michael Brown", "789"]
I could then use the following custom calculation script in the field for the Employee ID:
event.value = this.getField("Combo Box1").value;
Thanks.. I don't know much on scripts, but I'm working on getting better at this...
Is there anyway to have the dropdown refer to the array vs typing in all the values..
I have 30 names and email addresses
the dropdown is the name, the email is the corresponding export value
I know lazy...
One can set the display value and an optional export value. Then one only needs to access the value of the dropdown box. You will have to include some control for when there is no name selected.
I am a dumb newbie, so I got it working, but yes I do have the issue of name is not in array. I will stumble through the exception issue