2 Replies Latest reply on Mar 17, 2017 2:48 AM by JR_Boulay

    if calculation = 0, view but do not print

    michellem38434587 Level 1

      Calculation results in a zero which appears in the field.  My form will be used for both online and hand-written completion.  I am K with keeping the 0 when viewing and/or completing online, but do not want it to print   Is there a validation script?

        • 1. Re: if calculation = 0, view but do not print
          MinusZero Level 3

          Not sure if you are using LiveCycle, but it you are. This is pretty basic.


          In the form's preprint event use:

          if (this.resolveNode("TextField1").rawValue == "0") {

            this.resolveNode("TextField1").presence = "invisible";



          and in the postprint event use:

          if (this.resolveNode("TextField1").rawValue == "0") {

            this.resolveNode("TextField1").presence = "visible";



          When the form is printed (or cancelled before printing, if the textfield is 0, the field is made invisible. After printing, if the field is 0 (which it would still be), then it will be made visible again.

          • 2. Re: if calculation = 0, view but do not print
            JR_Boulay Adobe Community Professional



            Assuming that the form have a white background, I use a Validation script that colors the number to white if = zero.

            So it's invisible on the screen and on the paper.


            event.target.textColor = event.value == 0 ? color.white : color.black;