Skip to main content
stepheng54012748
Known Participant
November 21, 2024
Answered

Validation javascript for an event in an Adobe form field

  • November 21, 2024
  • 1 reply
  • 584 views

Hello,

 

I'm trying to write a validation javascript that yields blank in the field if the other fields are blank.  Right now the result could yield a positive or negative number, which is fine.  But if nothing is in the fields it would be nice to not have a zero as a result.  Here is the script that i came up with.  Thank you (AS ALWAYS) for your input.

 

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

This topic has been closed for replies.
Correct answer PDF Automation Station

I'm assuming your field is calculated from other fields and also formatted as a number but you don't want the zero to show?

Change your script to the following and enter at the end of your calculation script, instead of validation:

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

1 reply

PDF Automation Station
Community Expert
Community Expert
November 21, 2024

I'm assuming your field is calculated from other fields and also formatted as a number but you don't want the zero to show?

Change your script to the following and enter at the end of your calculation script, instead of validation:

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

stepheng54012748
Known Participant
November 21, 2024

That is correct and the answer is now correct!  THANK YOU again.