I'm having a little trouble getting part of the following code to work and I wonder if anyone can tell me why some of it isn't working or give me a clue to get it to work. Here is the code that I have commented out to play it safe.
/*
function getTeamMemberNames()
{
//Part A
TimeSheetSF.DetailsTable.Details.ItemNumber.rawValue = "";
TimeSheetSF.DetailsTable.Details.ItemNumber.clearItems();
//Part B
TimeSheetSF.EmployeeInfoSF.TeamMemNamesDrop.rawValue = "";
TimeSheetSF.EmployeeInfoSF.TeamMemNamesDrop.clearItems();
switch (xfa.event.newText)
{
case "Team 0":
TimeSheetSF.EmployeeInfoSF.TeamMemNamesDrop.addItem("Steven");
TimeSheetSF.EmployeeInfoSF.TeamMemNamesDrop.addItem("Jim");
break;
case "Team 1":
TimeSheetSF.EmployeeInfoSF.TeamMemNamesDrop.addItem("Carla");
TimeSheetSF.EmployeeInfoSF.TeamMemNamesDrop.addItem("Robert");
break;
default:
break;
}
}
*/
The part of the code that is not working is the part labeled Part A. Part B works just fine and puts the names in a dropdown field. Part is is trying to put the same names into a dropdown field that repeats in a table. I have always had trouble getting dropdown fields that repeat to be populated with a list.
I don't know if this is enough to go on but I have to start somewhere.
StevenD
If anyone knows how to populate multiple instances of dropdowns using JavaScript kindly let me know it is done.
StevenD