Skip to main content
ericac48391281
Participant
September 6, 2018
Answered

Sentence case PDF Form

  • September 6, 2018
  • 1 reply
  • 2315 views

I am setting up a form in Adobe Acrobat 9. I have a user who likes to type in all caps, so I want to try to set up a text field on my form that changes the case to only capitalize the first letter of each sentence, not each word.  For example, change:  THIS IS MY SENTENCE. to This is my sentence. 

This topic has been closed for replies.
Correct answer try67

Hmmm, that still didn't work for the second sentence.  The first letter of the first sentence changes to a capital letter, but still not the second. This is what my output looks like:

This is my sentence. this is my sentence.

Wait that works if I hit enter after the sentence, but the users may not always hit enter after every sentence, anyway to get it to trigger once they space after the period? 

Thanks again for your help!!


So you're talking about actual sentences, not lines? That will require a much more complex tool.

I suggest you try to study JavaScript's String and RegExp objects, as they provide all the tools you need to achieve it.

If you want me to write the full code for you (for a fee), feel free to contact me privately via try6767 at gmail.com.

1 reply

try67
Community Expert
Community Expert
September 6, 2018

What about if they write something like:

HI, I AM GOING TO FRANCE

Do you want it to become:

Hi, i am going to france

?

ericac48391281
Participant
September 6, 2018

That would be okay, as I don't expect proper names to be typed in this particular field that often and the form itself is only for internal use.  I just want to eliminate the ALL CAPS, as that is hard to read.

try67
Community Expert
Community Expert
September 6, 2018

Use this code as the field's custom validation script, then:

event.value = event.value.substring(0,1).toUpperCase() + event.value.substring(1).toLowerCase();