Planet PDF Forum Archive

Planet PDF  ForumThe page you are viewing is part of our 160,000 page discussion forum archive. See below for PDF-related discussions spanning 1999-2008. To ask questions and get help, head to the live Planet PDF Forum.


How to search this archive. The quickest way is to use the filters on our Advanced Search page so that only archive pages are included in the results.


Previous | Next | (P-PDF) JavaScript


Topic: How to print a blank in a field if calc is 0
Conf: (P-PDF) JavaScript, Msg: 32390
From: george
Date: 1/8/2002 06:36 PM

> I am doing some calculations in some fields
> sometimes the result is 0. I dont want to print a
> zero I would like to print a blank. How can I do
> this in javascript?

You have to use a custom Calculation script. For example, if you want to add the two fields named "text1" and "text2", you might do something like:

// Get field values, multiplying by 1 to ensure
// we're dealing with numbers and not strings
var v1 = getField("text1").value * 1;
var v2 = getField("text2").value * 1;

// Perform calculation
var sum = v1 + v2;

// Display only if result is non-zero
if (sum != 0) event.value = sum;
else event.value = "";

George





PDF In-Depth Free Product Trials Ubiquitous PDF

Pitstop Pro

Now graphic arts professionals have even broader and more expert control over their PDF documents. With...

Download free demo

ARTS PDF Aerialist

The ultimate plug-in for Adobe Acrobat and #1 selling product at PDF Store. Advanced splitting, merging,...

Download free demo

Ubiquitous PDF: Free short film distribution guide released

Nigel Smith, an award-winning producer of short films, has released a free PDF guidebook to help budding filmmakers find wider audiences for their short films.

December 04, 2008
Search Planet PDF
more searching options...




PDF Resources
Platinum Sponsor
Create & Edit PDF - Nitro PDF Software

ARTS PDF

Silver Sponsors

PDF-Tools enfocus

FileOpen PDFNet SDK: PDF Component. Cross-platform PDF library

PDF Converter: Create, Convert PDF to Word/Excel Visual Integrity: Convert, Create, Extract, Merge and Modify PDF

Debenu: Desktop Document Management, Archiving and Tagging Software SmartSoft

Get Nitro PDF Professional
Featured Product

NITRO PDF Professional

Built from the ground up, the perfect desktop PDF product for business and enterprise. Nitro PDF Professional has an uncompromising feature set so you can create, combine, edit, collaborate on and...

Featured Event

No upcoming events

PDF Store Categories