6 Replies Latest reply on Dec 20, 2016 7:02 AM by KrisHunt

    Combobox populated with Javascript keeps resetting to first option

    KrisHunt Level 4

      I'm new to Javascript in PDF forms. I'm trying to put a combobox (named "Additional Users") on a PDF form that populates with values from an array. According to this help page, it looks like you can use a 2D array to store the keys and values for the combobox.


      What I've done will populate the combobox, but once you select an option and click away from it, the value resets to the first option, which in this case is 0. In fact, even the example code from the help page does the same thing when I try it out in my form. What am I doing wrong?


           var dropdown = this.getField("Additional Users");

           dropdown.setItems([ ["0", 0], ["5", 5], ["10", 10], ["15", 15] ]);