Home » PDF Forms, PDF JavaScript

Tip: Using a Calculation to Hide/Show a Field

8 Jan 2009 | | 2 Comments

Well, it’s been a while since I’ve worked with PDF and JavaScript, but I always remember that with a bit of patience and know-how, you really could accomplish some pretty amazing tasks. I asked my friend Thom Parker, CEO of pdfscripting.com and WindJack Solutions if had any examples to get me started again and he sent me back this tip.

I like the way he’s put it together — the instructions and the working example are contained within a single page PDF,  Using a Calculation to Hide/Show a Field (right-click and choose save-as).

Acrobat provides easy, non-scripting methods for adding many types of calculations to a form, such as summing entries in a column or adding tax into a total. But what do you do if you want a calculation that does something that’s not just math? For example, maybe you have a form on which you want to show a field only when the field’s calculation result is greater than zero. While the calculation itself might be straightforward, the total result of the calculation is not. For this we need to use JavaScript…

As he says, it’s simple, and this same technique can be used to control all kinds of form field properties through calculation results…. Thanks Thom!

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)


  • mergepdf.net joins the ranks of online PDF merging utilities | 4xPDF Blog said:

    […] I have found at least one document containing JavaScript (such as our Tip from PDFScripting.com to Show/Hide form fields) does not function correctly after merging with all of these services. Related Posts:Merge PDFs […]

  • Bala said:

    it was a nice info. I got what i was searching for.
    Handy and useful. Will be recommended.:)

Leave your response!

You must be logged in to post a comment.