Skip to main content
Participant
April 21, 2022
Answered

When a calculated field is zero, I would like it to print blank.

  • April 21, 2022
  • 2 replies
  • 2839 views

When I use the java script in Validation,

if (event.item ==0) event.item = "";

I saw this on another post.

I received the message

Syntax Error: missing ) at condition 1: at line 2.

I don't know what I am doing wrong.  I know I am missing a ) but I don't know where I need to add it.

This topic has been closed for replies.
Correct answer Nesa Nurani

I just saw how to attach.  Here it is.


It's validation script, you need to change value of the field to trigger script,try changing value and then back to 0.

2 replies

try67
Community Expert
Community Expert
April 21, 2022

There's no such thing as "event.item" in Acrobat JavaScript.

try67
Community Expert
Community Expert
April 21, 2022

Use this code:

if (event.value==0) event.value="";

Legend
April 21, 2022

Hello @Mary241430957hka,

 

Can you post the entire code?

 

Regards,

Mike

Participant
April 22, 2022

I no longer receive the syntax error but the zero is still printing in the calculation field on the form.  The calculation field is a currency field.

 

Here is what I put in the Valdate Window under custom:

if (event.value==00) event.value = "";

 

Thank you for help.  I tried Adobe customer support and I was on Chat for over 45 minutes and shared my screen and they told me they don't do java script. 

Nesa Nurani
Community Expert
Community Expert
April 22, 2022

Can you share file?