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

Force first two letters Upper Case & if sentence proper case?

jenawyn
Registered: Apr 1 2011
Posts: 12
Answered

Hi, would like to do this in a textfield.
 
If this is entered.
 
mi10-456899-00 I would like the first two letters upper case like so
MI10-456899-00
 
and if words are entered to have first letter of every word upper case.
 
i have another job to do.
 
I Have Another Job To Do.
  
Thanks all help appreciated.
 

My Product Information:
Acrobat Pro 9.4.2, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Accepted Answer
If only the first 2 characters are alpha for all possible entries, then you can force the string to uppercase using the 'toUpperCase()' method.

If you want this only after the entry, you can use the Validate tab and a custom vailidation scirpt:

// force entry to upper case
event.value = event.value.toUpperCase();

If you want it converted you enter each keystroke, then the coding gets more complex and you would need to provide more information about the inputted keystrokes. You can do this with the RegEx object.

You can search for "Title Case" for code to perform title case, but to combine them will be more comples and require RegEx processing.

George Kaiser