1 Reply Latest reply on May 15, 2016 9:36 AM by gkaiseril

    How to set fields based on dropdown box value

    cbearsfan

      I am trying to create a document that has 4 separate sections, and I want to have a dropdown box value set a whole section of field or multiple sections to "N/A" when not required or leave BLANK for required depending on the selection of the dropdown.  I have tried to write a code to change these sections and have had minimal progress.  I am stuck when I set the dropdown to set a section to "N/A", then change the dropdown to make the same section to blank to indicate required, it doesn't reset the field appropriately.  I have tried to code each field box (very cumbersome) and also have tried to trigger on event of the dropdown box.  Can anyone be of any help on how I should approach this?  Any help is appreciated

      Example:

      When condition A is selected; I want sections of field 1 and 3 to be "N/A" and field sections 2 and 4 to be left blank to show it needs users inputs.

      When condition A is changed to condition B; I want sections of field 1 and 2 to be "N/A" and fields sections 3 and 4 to be left blank for user inputs.

        • 1. Re: How to set fields based on dropdown box value
          gkaiseril MVP & Adobe Community Professional

          You need to use custom JavaScript code to accomplish this.

           

          What have you tried?

           

          Since there is custom JavaScript involved, each field being modified each field's object needs to be accessed before one cah adjust the value of that field.

           

          In many cases if a script does not update a field as expected there could be an error in the code.

           

          Do you receive and pop-up messages?

           

          Have you checked the Acrobat JavaScript console for any error messages?

           

          Are you trying to put the "N/A" into fields formatted as "Number".? If so, this can be very hard to make work since one needs to dynamically change the field's format.