Calculation Sum zeros

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

eson
User
Posts: 18
Joined: Tue Mar 29, 2016 1:30 pm

Calculation Sum zeros

Post by eson »

Hi,

I made a nice form field document for work report and everything is fine. There's just one thing I am wondering about... is there a way to disable all the zeros in sum field?
I know about the visibility options but that doesn't cover my needs. I just want to disable the zeros as long as there is nothing to sum.

Image
Willy Van Nuffel
User
Posts: 2773
Joined: Wed Jan 18, 2006 12:10 pm

Re: Calculation Sum zeros

Post by Willy Van Nuffel »

I do not know if this information can already help you...

The "Properties" of a text box where you like to see nothing in case if it is 'zero', should have to following particular settings:
- Format Value > Category = Number
- Value Validation > Validation = Custom Action
- Validation action = Run a JavaScript... --> if (event.value==0) event.value = "";

Myself, I do not know if there exists a general setting to make this happen for the whole PDF.
Actually, you have to change these settings separately for each individual text box.
User avatar
Patrick-Tracker Supp
Site Admin
Posts: 1645
Joined: Thu Mar 27, 2014 6:14 pm

Re: Calculation Sum zeros

Post by Patrick-Tracker Supp »

Hello eson,

Willy is right, there is no such setting for this, so you will need to use JavaScript. Complex forms do often require the use of JavaScript.

I hope this helps!
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Cheers,

Patrick Charest
Tracker Support North America
eson
User
Posts: 18
Joined: Tue Mar 29, 2016 1:30 pm

Re: Calculation Sum zeros

Post by eson »

I was suspecting that I needed a script, but scripting is definitely not my speciality, so thanks a lot for the script. It solved my problem very elegant. :D
Willy Van Nuffel
User
Posts: 2773
Joined: Wed Jan 18, 2006 12:10 pm

Re: Calculation Sum zeros

Post by Willy Van Nuffel »

:-)
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm

Re: Calculation Sum zeros

Post by Will - Tracker Supp »

Thanks again Willy! :D
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com