These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How to have all Caps as default on form fields

fendel
Registered: Sep 29 2011
Posts: 6

Hello all,
 
Can you specify how i can create a field on my form that allows the user to enter data (his first name for example) and the default type face appears in Capital letters.
 
for example: JOHN
   

fen

My Product Information:
Acrobat Pro 10.0, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
You can use the 'toUpperCase()' method of the string object.

If you want it done as the input is typed, you need to use a custom keystroke JavaScript.

If you want it after the entry is completed, you can use the a custom format JavaScript, custom JavaScript "on blur" action, or custom JavaScript validation.

George Kaiser

fendel
Registered: Sep 29 2011
Posts: 6
Thanks gkaiseril!

I am new to JavaScript so what would be the "code" if i wanted to have the type face done in Capital letters as the user types?

fen

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
You can use:

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

You could also create a document level function that could be called by almost any action.

function ToUpper(sText) {
return sText.toUpperCase();
}

For keystroke:

event.change = ToUpper(event.change);

For format, calculation, or on blur action:

event.value = ToUpper(event.value);

But there is not much in keystroke savings and since the code is short, there might not be a great improvement in efficiency.

George Kaiser

fendel
Registered: Sep 29 2011
Posts: 6
So i went into the Text Field Properties->Actions->Select Trigger(Mouse down)->Select Action(Run a JavaScript)->Add(event.change = UpperCase(event.change);)but it didn't work when i tried to type a letter into the field it was still lower case. Ami i doing it right?

fen

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
You open the field properties, Format, Custom, Custom Keystroke Script.

The 'change' property of the 'event' object is only available for the Keystroke action while this action is being processed. After the updated field has been committed, the 'change' property no longer exist.

George Kaiser

fendel
Registered: Sep 29 2011
Posts: 6
Thanks gkaiseril!!

It worked....But only the this line i needed "event.change = event.change.toUpperCase();" in the keystroke


fen

fendel
Registered: Sep 29 2011
Posts: 6
Hey George,

I am posting this form on a website i am developing. I want users to fill out the form and submit it to me. I would like for the submitted forms to be archived in a folder on my server.

I already created a submit button but i am having problems with the URL. Is this the best way to go about submitting the form

fen