• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
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

Copy link to clipboard

Copied

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

TOPICS
PDF forms

Views

422

Translate

Translate

Report

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

correct answers 1 Correct answer

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();

Votes

Translate

Translate
Community Expert ,
Jan 15, 2024 Jan 15, 2024

Copy link to clipboard

Copied

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();

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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();

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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();

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Only letters can be in upper case.

😉

Votes

Translate

Translate

Report

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