


I have a field for comments. The users enter paragraphs about thier experiences. I have several users who always type in all caps and it becomes very difficult to read. Is there a script to convert uppercase to sentence case? I'm not even sure if sentence case is the correct terminology.
Views
Replies
Sign in to like this content
Total Likes
Check this thread: http://forums.adobe.com/thread/909713
Views
Replies
Sign in to like this content
Total Likes
This works for one sentence. But once the next sentence begins how do I script it to recognize a new sentence begins?
Views
Replies
Sign in to like this content
Total Likes
Try this:
this.rawValue = this.rawValue.replace(/(^|\.\s*)([a-z])/g, function (_, first, initial) {return first+initial.toUpperCase();});
Kyle
Views
Replies
Sign in to like this content
Total Likes
Thank you but that didn’t work.
I am trying to convert sentences that were typed in all caps to sentence case.
Views
Replies
Sign in to like this content
Total Likes
Oh ya. Put this first then:
this.rawValue=this.rawValue.toLowerCase();
Kyle
Views
Replies
Sign in to like this content
Total Likes
Thanks, that works great. But one other thing. There are words now that become lower case, such as names that need to be capitalized.
Is there a way for me to be able to edit the words?
Views
Replies
Sign in to like this content
Total Likes
The only way to automate the task is to have a source of proper names you can reference. Besides that is to manually edit the names yourself.
Kyle
Views
Replies
Sign in to like this content
Total Likes
Thank you for your reply.
It would not let me manually edit the names after the script changed it to lower case.
Do you have any other suggestions?
Views
Replies
Sign in to like this content
Total Likes
You could try putting in a condition that only runs the code when you hold down the Ctrl key:
if (xfa.event.modifier){
.
.
.
}
Kyle
Views
Replies
Sign in to like this content
Total Likes
Do I put this before the code to change the font or afterward?
Views
Replies
Sign in to like this content
Total Likes