0 Replies Latest reply on Apr 30, 2015 9:59 AM by Clark2015

    Changing multiple combo box values based on each other

    Clark2015

      I have 3 Combo boxes, Box A, Box B, and Box C. Box A needs to control what values are available in Box B and Box B needs to control what values are available in Box C. The examples I've seen have only been using one combo box to change another and use custom keystroke javascript that uses the .willCommit function. When I use this method and change the value of Box A, Box B updates but Box C doesn't. I made my own code that I put in the Calculation tab instead of the Format tab but as you can see below it is very limited in what it can do before it stops working. Any suggestions on what to do would be great.

       

      Code in the Calculate Tab of Box A

       

      if (event.value == 'BoxAchoice 1') {

      var c = this.getField("Box B");

      c.clearItems();

      c.insertItemAt("BoxBchoice1");

      } else {

      var c = this.getField("Box B");

      c.insertItemAt("BoxBchoice2");

      c.insertItemAt("BoxBchoice3");

      }

       

       

      Code in Calculate Tab of Box C

       

      var c = this.getField("Box B").value;

      if (c == 'BoxBchoice1') {

      var cm = this.getField("Box C");

      cm.deleteItemAt()

      cm.insertItemAt("BoxCchoice1");

      cm.insertItemAt("BoxCchoice2");

      } else {

      var cm = this.getField("Box C");

      cm.clearItems();

      cm.insertItemAt("BoxCchoice3");

      }

       

      No script in Box B