2 Replies Latest reply on Sep 20, 2017 2:35 PM by Lisa Forrest

    How to set form field not to print if blank

    Naomi Kelly

      I have a form with a drop down menu with the default item reading "select one". I would like to not have this field print(just have a blank box) for individuals that prefer to print and hand write the form. I do still need the field to print if the user makes a selection and we print it later.

       

      Please let me know how this could be done.

       

      Thanks!

        • 1. Re: How to set form field not to print if blank
          try67 MVP & Adobe Community Professional
          Embed this code as the file's Will Print event (via Document - JavaScript - Set Document Actions):

           

          var f = this.getField("Enter field name here");
          if (f.value==f.defaultValue) f.display = display.noPrint;
          else f.display = display.visible;
          

           

          This will cause the field to become non-printable (but still visible) if the selected value is the default value. Otherwise it will switch back to visible and printable.

          1 person found this helpful
          • 2. Re: How to set form field not to print if blank
            Lisa Forrest Level 1

            This worked well for me except that I have 60 fields on an order form that I would like to print if only if they contain a value. Our network members will regularly fill out the form on the computer, print it and scan it to me but others will print a blank form and fill out by hand.  The field names that I would like to print only if they contain a value all start with "Quantity" or "Price". Is there a way to apply the

            1. if (f.value==f.defaultValue) f.display = display.noPrint; 
            2. else f.display = display.visible;

            To more than one field at a time?