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

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

New Here ,
Mar 24, 2024 Mar 24, 2024

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
418
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
1 ACCEPTED SOLUTION
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;

View solution in original post

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 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;

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

Thank you so much! This worked perfectly!

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