Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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);
Copy link to clipboard
Copied
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);
Copy link to clipboard
Copied
Thanks, this works perfectly.
Copy link to clipboard
Copied
You can use a script that convert the input in lowercase and add one capital letter to each word.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Sure
![]()
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more