Javascript to format text to all caps in Acrobat 5.0 Form

Posted on 2004-07-30
Last Modified: 2008-01-09
I would like to write a Javascript function in the "format" section of a text box on an Acrobat form.  I have tried a number of things, however it will not work because of definitions.  I do not know how it needs to see things, however all I want is a format script to run so that whatever a user types into a the text box on the Acrobat form is auto formatted to ALL caps.



Question by:Anjinsan5
  • 4
  • 2
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 11679121
Open up the properties dialog for your text box. Select the "Format" tab and select "Custom" for the category. In the "Custom Format Script" field enter the following JavaScript:

event.value = event.value.toUpperCase();

This will (at the time the new text field value is commited) convert the string to all caps. The string that is actually stored in the text field is still as it was entered, it's just the export value that gets modified. And, while you are entering the data, you will not see the upper case characters.

Is this what you want?

Author Comment

ID: 11679353
I would like to be able to SEE the character as upper there a way to do this?

LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 11679429
Do you want to see them as you type? The caps string is displayed one you leave the field (with either RETURN, or TAB).
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

LVL 44

Accepted Solution

Karl Heinz Kremer earned 500 total points
ID: 11679533
If you want every keystroke to be converted to caps right away, use this script in the "Custom Keystroke Script" field:

event.change = event.change.toUpperCase();

LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 11691963
Is this now working as you expect it to work?

Author Comment

ID: 11708415
Works now!  Sorry for the delay!


Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Acrobat’s JavaScript is a great tool to extend the application, or to automate recurring tasks. There are several ways a JavaScript can be added to the application or a document (e.g. folder level scripts, validation scripts, event handling scripts,…
Getting information about Fonts being used in a PDF file A colleague of mine recently faced an issue related to the PDF file format. The PDFs were containing mission critical client information, they were successfully mailed but there was a sm…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now