Skip to main content
Known Participant
March 12, 2018
Answered

Field not to accept all uppercase letters

  • March 12, 2018
  • 3 replies
  • 796 views

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.

This topic has been closed for replies.
Correct answer try67

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

3 replies

JR Boulay
Community Expert
Community Expert
March 12, 2018

Sure

Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
Community Expert
March 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
try67
Community Expert
Community Expert
March 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.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
March 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);

Known Participant
March 12, 2018

Thanks, this works perfectly.