Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
6

In Acrobat Pro, is it possible for letters input in a text field to be automatically made uppercase?

New Here ,
Jan 14, 2024 Jan 14, 2024

Further, is possible to restrict the text field to letters and hyphens?

TOPICS
PDF forms
645
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Jan 15, 2024 Jan 15, 2024

You can do it using this code as the field's custom Keystroke script:

 

event.rc = /^[-a-z]*$/i.test(event.change);
event.value = event.value.toUpperCase();

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 15, 2024 Jan 15, 2024

You can do it using this code as the field's custom Keystroke script:

 

event.rc = /^[-a-z]*$/i.test(event.change);
event.value = event.value.toUpperCase();
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 15, 2024 Jan 15, 2024

Thank you! I had omitted that the field should be able to accept spaces as well, but then adding a space to the character class, as follows, sorted that out.

event.rc = /^[-a-z ]*$/i.test(event.change);
event.value = event.value.toUpperCase();

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 16, 2024 Jan 16, 2024
LATEST

If you want to show uppercase as soon as you type it, replace:

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

with:

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

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 15, 2024 Jan 15, 2024

"is possible to restrict the text field to letters and hyphens?"

Only letters can be in upper case.

😉


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines