hello, when i use this sample script, it works fine. but when i add additional arrays to it, it doesn't work at all. please let me know what i need to change in this script in order to add additional items into the drop down lists. here is the script that works (displays 3 options in first drop down list (blank, option, another option)):
// This script object controls the interaction between the carrier and plan Drop-down lists.
// The array contains the carriers and the corresponding plans.
var myCarriers = new Array(new Array(2), new Array(14), new Array(17)); // Create a two-dimensional array.
// For each carrier, add a 'new Array(number of plan +1)'.
// Define the carrier and the corresponding plans.
// The array syntax is arrayName[index][index].
// The first index number represents the carrier,
// the second index number is the actual data value.
myCarriers[0][0] = " "; // The first items in the Drop-dowm Lists should be blank.
myCarriers[0][1] = " ";
myCarriers[1][0] = "ANERT"; // The first data value is the carrier name,
myCarriers[1][1] = "MC250"; // the rest are plans.
myCarriers[1][2] = "MC2501";
myCarriers[1][3] = "MC5002";
myCarriers[1][4] = "MC5003";
myCarriers[1][5] = "MC1000";
myCarriers[1][6] = "MC2000";
myCarriers[1][7] = "MCHC2300";
myCarriers[1][8] = "MCHC3000";
myCarriers[1][9] = "MC2500";
myCarriers[1][10] = "MB";
myCarriers[1][11] = "P500";
myCarriers[1][12] = "MHH3000";
myCarriers[1][13] = "MHH5000";
myCarriers[2][0] = "BCCA"; // This is a new carrier, see how the first number is now [1].
myCarriers[2][1] = "S Plan";
myCarriers[2][2] = "BPlan";
myCarriers[2][3] = "P40";
myCarriers[2][4] = "P30";
myCarriers[2][5] = "P35*";
myCarriers[2][6] = "P45*";
myCarriers[2][7] = "Ad25*";
myCarriers[2][8] = "Pr20";
myCarriers[2][9] = "Pr10";
myCarriers[2][10] = "PH750*";
myCarriers[2][11] = "PH500*";
myCarriers[2][12] = "2400HD";
myCarriers[2][13] = "3500HD";
myCarriers[2][14] = "2000HD";
myCarriers[2][15] = "LH1500";
myCarriers[2][16] = "LH3000";
// This function will populate the carrier Drop-down List.
// This function is called from the initialize event of the carrier Drop-down List.
function getCarriers(dropdownField)
{
dropdownField.clearItems();
for (var i=0; i < myCarriers.length; i++)
dropdownField.addItem(myCarriers[i][0]);
}
// This function will populate the plans Drop-down List for any event EXCEPT the change event.
// This function is called by the initialize event of the plan Drop-down List.
function getPlans(carrierField, dropdownField)
{
dropdownField.clearItems(); // Clear the items of the Drop-down List.
for (var i=0; i < myCarriers.length; i++) // Look through all the carriers until we find the one that matches the carrier selected.
if(myCarriers[i][0] == carrierField.rawValue) // Check to see if they match.
{
for (var j=1; j < myCarriers[i].length; j++) // When they match, add the plans to the Drop-down List.
{
dropdownField.addItem(myCarriers[i][j]);
}
dropdownField.rawValue = myCarriers[i][1]; // Display the first item in the list.
}
}
// This function will populate the plans Drop-down List for the change event.
// This function is called by the change event of the carrier Drop-down List.
// The first parameter is simply a pointer to the xfa object model.
function getPlansOther(myXfa, dropdownField)
{
dropdownField.clearItems(); // Clear the items of the Drop-down list.
for (var i=0; i < myCarriers.length; i++) // Look through all the carriers until we find the one that matches the carrier selected.
if(myCarriers[i][0] == myXfa.event.newText) // Check to see if they match. Note: we have to use the event.newText in this case because
{ // the ch