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

Making text appear when another (calculated) field is a negative value

New Here ,
Mar 24, 2024 Mar 24, 2024

Copy link to clipboard

Copied

Hi there

I'm creating a form in Acrobat Pro and one of the fields is calculated (Income minus Expenses = Net profit or Net Loss). When there is a Net Loss (negative value), I would like text to appear to say something along the lines of: "You are spending more than you earn". The negative value is an acceptable outcome, I just want to alert the user to the Net Loss.

Is there any way to do this?

Thank you 🙂

TOPICS
Create PDFs , General troubleshooting , How to , JavaScript , PDF , PDF forms

Views

238

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Mar 24, 2024 Mar 24, 2024

Create a (read-only) text field with this text set as its default value, and use the following as its custom calculation script:

event.target.display = (Number(this.getField("Net Result").value)<0) ? display.visible : display.hidden;

Votes

Translate

Translate
Community Expert ,
Mar 24, 2024 Mar 24, 2024

Copy link to clipboard

Copied

Create a (read-only) text field with this text set as its default value, and use the following as its custom calculation script:

event.target.display = (Number(this.getField("Net Result").value)<0) ? display.visible : display.hidden;

Votes

Translate

Translate

Report

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
New Here ,
Mar 25, 2024 Mar 25, 2024

Copy link to clipboard

Copied

LATEST

Thank you so much! This worked perfectly!

Votes

Translate

Translate

Report

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