Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

if calculation = 0, view but do not print

Participant ,
Mar 16, 2017 Mar 16, 2017

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?

TOPICS
Acrobat SDK and JavaScript , Windows
261
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 16, 2017 Mar 16, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 17, 2017 Mar 17, 2017
LATEST

Hi.

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;


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines