4 Replies Latest reply on Jun 20, 2016 3:06 AM by juanf84170032

    getField("xxxx").value returns an incorrect value from a dropdown list control, if the value "yes" is selected, the getfield("xxx").value returns "No", and vice versa. This seems to be a bug with Acrobat DC Pro....

    juanf84170032

      A simple PDF form with multiple fields,  a validation java script to set required fields based on a value selected in a dropdown.

      getField("xxxx").value returns an incorrect value from a dropdown list control, if the value "yes" is selected, the getfield("xxx").value returns "No", and vice versa. This seems to be a bug with Acrobat DC Pro....

       

      Had to do reverse logic to get this to work, however on data extract, incorrect data value is exported

       

      var Name = this.getField("Customer_LandLordDetails_Name");

      var Street = this.getField("Customer_LandLordDetails_Street");

      var Suburb = this.getField("Customer_LandLordDetails_Suburb");

      var City = this.getField("Customer_LandLordDetails_City");

      var Province = this.getField("Customer_LandLordDetails_Province");

      var Country = this.getField("Customer_LandLordDetails_Country");

      var PostalCode = this.getField("Customer_LandLordDetails_PostalCode")

      var ContactName = this.getField("Customer_LandLordDetails_ContactName");

      var Telephone = this.getField("Customer_LandLordDetails_Telephone");

      var Email = this.getField("Customer_LandLordDetails_Email");

      var Owned = this.getField("Customer_RegisteredAddress_Owned");

      if (Owned.value != "Owned"){

      console.println("Value = Owned " + Owned.value);

      Name.required = false;

      Street.required = false;

      Suburb.required = false;

      City.required = false;

      Province.required = false;

      Country.required = false;

      PostalCode.required = false;

      ContactName.required = false;

      Telephone.required = false;

      Email.required = false;

      } else {

      console.println("Value != Owned " + Owned.value)

      Name.required = true;

      Street.required = true;

      Suburb.required = true;

      City.required = true;

      Province.required = true;

      Country.required = true;

      PostalCode.required = true;

      ContactName.required = true;

      Telephone.required = true;

      Email.required = true;

      }