1 Reply Latest reply on Nov 22, 2017 9:02 AM by Thom Parker

    Hiding Form Fields Depending On Selection

    ndestructoid

      Hello all,

      I'm currently in the process of creating a form with multiple different form fields and I only want certain fields to populate, based on what action the user selects from the primary field. I have been using the following script:

      if (this.getField("Status Change").value == "Enter Value"){

      event.target.display = display.visible;

      }

      else if (this.getField("Status Change").value == "Enter Value") {

      event.target.display = display.visible;

      }

      else{

      event.target.display = display.hidden;

      }

       

      This script does exactly what I need it to do, but since there are a bunch of different form fields in this document, I have to manually add this script to each form field under Calculate > Custom calculation script. I am looking for an easier way to do this if possible.

       

      Thanks!

        • 1. Re: Hiding Form Fields Depending On Selection
          Thom Parker Adobe Community Professional

          Since the value of one field (the source) is changing several other fields (the targets), it's best to put the code in the source field, i.e. "Status Change". So you are driving the action from the source of the change.

          And don't use a calculate event. This event is called every time any field is changed, so they are called all the time and a lot of them will slow down the form.

           

          Use the Keystroke or format event, it's only called once when the user changes the specific field.

           

          Is the "Status Change" field a Combo Box (drop down list)? This article will help, it's about changing data in several fields from a selection in a dropdown, but can easily be modified to do what you want.

           

          https://acrobatusers.com/tutorials/change_another_field