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

how do i convert a text string to proper case

New Here ,
Sep 19, 2016 Sep 19, 2016

I am new to Adobe Acrobat Pro DC. I want to do several things.

Firstly, convert a text string to proper (title) case.

Secondly I want to have a field duplicate the value entered into another field.

Thirdly I want to calculate the age of a person based on their date of birth and a given date (not based on today's date).

TOPICS
Acrobat SDK and JavaScript , Windows
862
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
LEGEND ,
Sep 19, 2016 Sep 19, 2016

These questions have  been answered many times in these forms, please try the search feature.

You will need to write or adjust any script that creates Title case to exclude words that are not capitalized in the title.

Once one gets the dob and the cut-off date or current date as Date objects the computation of age is done exactly the same way.

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 09, 2021 Nov 09, 2021

hard to find using the search feature.   i too, am trying to convert text field to proper case and cannot easily find the solution

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 11, 2021 Nov 11, 2021
LATEST

You can use this function to do it:

 

function toTitleCase(s) {
	var words = s.split(" ");
	for (var i in words)
		words[i] = words[i].charAt(0).toUpperCase() + words[i].substr(1).toLowerCase();
	return 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