4 Replies Latest reply on Sep 17, 2017 9:06 AM by try67

    Adobe Forms - Text Field Visible based on Dropdown Selection

    darlyj38956125

      It seems simple enough, but I'm not sure what I'm doing wrong. I want TextFieldIwantvisible1 and TextFieldIwantvisible2 to appear if Dropdown1 or Dropdown2 is selected. But the default is to keep the Text fields hidden. Here's what I have below. Any help or guidance would be greatly appreciated. I've placed the code in the run custom validation script.

       

      var f=this.getField("TextFieldIwantvisible1");

      var g=this.getField("TextFieldIwantvisible2");

       

       

      if(event.willCommit)

      {

      console.printtln(event.value);

      switch(event.value)

      {

      case "Dropdown1":

      f.display = display.visible;

      g.display = display.visible;

                     break;

      case "Dropdown2":

      f.display = display.visible;

      g.display = display.visible;

                     break;

      Default:

      f.display = display.hidden;

      g.display = display.hidden;

                     break;

      }

      }