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

Change text to uppercase in a PDF Form

Guest
Feb 21, 2012 Feb 21, 2012

Hi,

Im very inexperienced in Adobe and have recently begun creating some forms for users to fill in.

I need to know how I can make the field automatically change what ever has been written in a text box to uppercase, and also if its possible just to change the first letter to upper case.

any help is greatly appreciated.

Thanks

TOPICS
Create PDFs , Edit and convert PDFs
83.8K
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 ,
Feb 21, 2012 Feb 21, 2012

You can use the custom format script, like this:

To convert the inserted value to all upper-case:

event.value = event.value.toUpperCase();

To convert just the first letter to upper-case:

event.value = event.value.substring(0,1).toUpperCase() + event.value.substring(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 ,
Feb 21, 2012 Feb 21, 2012

You can use the custom format script, like this:

To convert the inserted value to all upper-case:

event.value = event.value.toUpperCase();

To convert just the first letter to upper-case:

event.value = event.value.substring(0,1).toUpperCase() + event.value.substring(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
Guest
Feb 21, 2012 Feb 21, 2012

Thanks for the super fast response try67, i will give it a go now and see how it works.

On a different note, is there any way to export(or update) the filled data to a .csv file

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 ,
Feb 21, 2012 Feb 21, 2012

Yes, in Acrobat X go to Tools - Forms - More Form Options - Manage Form

Data - Import Data or Export Data

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
Guest
Feb 21, 2012 Feb 21, 2012

worked GREAT!! U saved me a lot of headache, thanks again.

Final question, is it possible to have the first letter of every field in the form be capital? or must I do the above forumla for individual fields?

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 ,
Feb 21, 2012 Feb 21, 2012

You need to apply it to each field separately, but this can also be done

with a script.

The best way is to place the code in a doc-level function, and then call

that function from the fields' formatting code.

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
Guest
Feb 21, 2012 Feb 21, 2012

all working now

Still cant figure out the export form filled data. When I select XML it starts to OCR and takes a while as it does the whole document. I only want the filled data to be exported to .csv

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
New Here ,
Mar 18, 2021 Mar 18, 2021

I figured out how to do it for each field separately, but I don't know how to do it for multiple fields at a time. Can you explain more? Thanks.

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
New Here ,
Feb 12, 2019 Feb 12, 2019

Guys, someone could be so kind to share me a PDF example with the working script please?

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
Guest
Jul 29, 2019 Jul 29, 2019

This really helped but I ran into one issue.

It works great for 1 word that has been input as lowercase.  Is there an option for inputs of all caps? or if there is an hyphenated name?

The examples below arent producing the desired results.  Is this possible?

THOMAS should change to Thomas but it remains THOMAS

thomas jones should change to Thomas Jones but it changes to Thomas jones

thomas-jones should change to Thomas-Jones but it changes to Thomas-jones

Thanks!

JT

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 ,
Jul 29, 2019 Jul 29, 2019

It's possible, but it will require a much more complex script. You would need to first split the name string using a regular expression with all of the characters that you want to use as the delimiters, then edit each "word" (ie, item in the array of the split method), and then re-combine the values in the array using the same delimiters as before...

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
Guest
Jul 29, 2019 Jul 29, 2019

Yeah, thats a little too intricute. 

What about the all caps to proper?  Is that one difficult too?  i.e.  THOMAS beinf forced to Thomas.  Is that easily workable?

JT

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 ,
Jul 29, 2019 Jul 29, 2019

Sure. You can use this code for that:

var name = event.value;

var words = name.split(" ");

for (var i in words) words = words.charAt(0).toUpperCase() + words.substring(1).toLowerCase();

event.value = words.join(" ");

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
New Here ,
Sep 12, 2019 Sep 12, 2019
Help! I'm trying to export the field data to a csv and keep the case. I'm running the script below to change case but when I export as a csv it places the test back to the original input case.
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
New Here ,
Nov 02, 2019 Nov 02, 2019

And I want to Capatilize each word then what is the Formula

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 ,
Nov 02, 2019 Nov 02, 2019

Look at reply of try67.

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
New Here ,
Nov 02, 2019 Nov 02, 2019

please provide javascript to change it to proper case

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 ,
Nov 02, 2019 Nov 02, 2019

Look at the replies!

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
New Here ,
Nov 02, 2019 Nov 02, 2019

i am a new user cant find replies please copy paste in my reply

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 ,
Nov 02, 2019 Nov 02, 2019
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
New Here ,
Nov 02, 2019 Nov 02, 2019

But Dear it does not capatilize first letter in each word it only capatilize 1st word of a sentence

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
New Here ,
Nov 02, 2019 Nov 02, 2019

And I want to Capatilize each word then what is the Formula

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 ,
Apr 05, 2023 Apr 05, 2023

Try67, 

Do you have a script to capitalize the first letter of every word in a string? 

For example: 

"1 first street" to "1 First Street"

 

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 ,
Apr 05, 2023 Apr 05, 2023

Look at reply of try67.

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 ,
Apr 05, 2023 Apr 05, 2023
LATEST

So as I read it, it requires a much more complex script. 

and this script is just for "Proper sentencing" 

var name = event.value;

var words = name.split(" ");

for (var i in words) words = words.charAt(0).toUpperCase() + words.substring(1).toLowerCase();

event.value = words.join(" ");

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