Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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);
Copy link to clipboard
Copied
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);
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Yes, in Acrobat X go to Tools - Forms - More Form Options - Manage Form
Data - Import Data or Export Data
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Guys, someone could be so kind to share me a PDF example with the working script please?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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...
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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(" ");
Copy link to clipboard
Copied
Copy link to clipboard
Copied
And I want to Capatilize each word then what is the Formula
Copy link to clipboard
Copied
Look at reply of try67.
Copy link to clipboard
Copied
please provide javascript to change it to proper case
Copy link to clipboard
Copied
Look at the replies!
Copy link to clipboard
Copied
i am a new user cant find replies please copy paste in my reply
Copy link to clipboard
Copied
You can see the replies here:
https://community.adobe.com/t5/Acrobat/Change-text-to-uppercase-in-a-PDF-Form/td-p/3941562
Copy link to clipboard
Copied
But Dear it does not capatilize first letter in each word it only capatilize 1st word of a sentence
Copy link to clipboard
Copied
And I want to Capatilize each word then what is the Formula
Copy link to clipboard
Copied
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"
Copy link to clipboard
Copied
Look at reply of try67.
Copy link to clipboard
Copied
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(" ");