6 Replies Latest reply on Sep 19, 2012 11:29 AM by lyav18

    How to clear or reset a combo box field


      I have a 2 combo boxes. The user selects a value for combo box 1, when the combo box 2 is selected I have a custom validation, in which I want the combo box 2 field to reset to default if the selected value is greater than the value in combo box 1. Here is the tested code:


      if (event.value > this.getField("combo box 1").value) {

      event.value = this.getField("combo box 2").defaultvalue;

      this.getField("comb box 2").setFocus();




      I've tried the following codes to try to reset the field, but none has worked:

      this.resetForm("combo box 2");

      this.getField("combo box 2").value = this.getField("combo box 2").default value;

      event.value = " ";

      event.value = "None";

      (where " " is the value of the default)

      (where None is the export value of the default value)


      I tried this.getField("combo box 2").setItems(["value 1"]); which does work, but I would then have to put the entire list of options in. I'm not sure if this is the ideal approach. I was sure that there is a simple code for this simple problem., but I googled till my eyes hurt, and am out of ideas, does anyone have any other suggestions? Thanks.


      Using Acrobat X Pro - Windows