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

Field not to accept all uppercase letters

Community Beginner ,
Mar 11, 2018 Mar 11, 2018

I have a field on an Acrobat form for given names and family name. Quite often the field is completed with all uppercase letters. I am looking at way to alert the user to enter upper and lower case letters when two or more consecutive uppercase letters are entered in the field. Any help would be appreciated.

TOPICS
PDF forms
849
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 ,
Mar 12, 2018 Mar 12, 2018

You can use something like this, as the field's custom validation script:

if (/[A-Z]{2}/.test(event.value)) app.alert("Make sure you're not entering the whole name in CAPITALS, please!",1);

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 ,
Mar 12, 2018 Mar 12, 2018

You can use something like this, as the field's custom validation script:

if (/[A-Z]{2}/.test(event.value)) app.alert("Make sure you're not entering the whole name in CAPITALS, please!",1);

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 Beginner ,
Mar 12, 2018 Mar 12, 2018
LATEST

Thanks, this works perfectly.

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 ,
Mar 12, 2018 Mar 12, 2018

You can use a script that convert the input in lowercase and add one capital letter to each word.


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
Community Expert ,
Mar 12, 2018 Mar 12, 2018

I would advise against doing that, as some names have capitals not at the start of the word ("John McGregor", for example), and others have words that shouldn't be capitalized at all ("Jan van der Steen", for example).

That's also why I didn't add a command to reject the value in the code I provided above. It's better to let the user decide how to enter their own name, just warn them in case of potential issues.

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 ,
Mar 12, 2018 Mar 12, 2018

Sure


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