I am using JavaScript Coding in LiveCycle and developing dependent drop-down boxes but I am having difficulty writing the correct code. See example below. I am trying to use a multiple case function that references an option that is listed numerous times in the previous drop-down. The problem that I am running into is that when I reference Chevy or Nissan and any color, it is returning the results of the color under the "Ford" column only. I will still see the color options (Blue, Black, Green and Purple) in my second drop down and it looks fine, but then the third drop-down only references "Ford" colors and options. (I did not list the code for the third drop-down).
I want the customer to choose Chevy or Nissan and then have its dependent drop downs (based on the color they chose), but I cannot seem to make this work.
I hope this is clear enough (probably as mud…). I would greatly appreciate any help!!
form1.#subform[0].#subform[1].cboModels::exit - (JavaScript, client)
cboColor.clearItems();
switch(this.rawValue){
case "Ford":
cboColor.addItem("Blue");
cboColor.addItem("Black");
cboColor.addItem("Green");
cboColor.addItem("Purple");
break;
case "Chevy":
cboColor.addItem("Blue");
cboColor.addItem("Black");
cboColor.addItem("Green");
cboColor.addItem("Purple");
break;
case "Nissan":
cboColor.addItem("Blue");
cboColor.addItem("Black");
cboColor.addItem("Green");
cboColor.addItem("Purple");
break;
}
form1.#subform[0].#subform[1].cboColor::exit - (JavaScript, client)
cboPrice.clearItems();
switch(this.rawValue){
case "Ford":
case "Green":
cboPrice.addItem("blah");
cboPrice.addItem("blah");
cboPrice.addItem("blah");
cboPrice.addItem("blah");
break;
case "Chevy":
case "Green":
cboPrice.addItem("blah");
cboPrice.addItem("blah");
cboPrice.addItem("blah");
cboPrice.addItem("blah");
break;
case "Nissan":
case "Green":
cboPrice.addItem("blah");
cboPrice.addItem("blah");
cboPrice.addItem("blah");
cboPrice.addItem("blah");
break;
}