Using JavaScript to Clear Default Text on PDF Forms

Making PDF Form Fields Dynamic with JavaScript

One of those tricks everybody always asks me for is the ‘default text goes away’ click
behavior in form fields. In this video, I demonstrate a bit of JavaScript code in a PDF
form that removes the default text, then puts it back in in the event you didn’t type anything.

I found the original code here:


  1. This makes use of JavaScript s handy ability to add arbitrary properties to any element.

  2. says:

    Is this to clear a default value or sample text that initially appears on the form?

Leave a Reply

Your email address will not be published. Required fields are marked *