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

Automatically change case to titlecase

Explorer ,
Oct 22, 2024 Oct 22, 2024

Hello!

 

Is there a way to set a text field to automatically convert text to titlecase?

 

The scenario includes copying all caps text from another document. When that all caps text pastes into the text field, is there functionality available to automatically convert it to titlecase?

 

Thank you so much for your help!

TOPICS
Create PDFs , Edit and convert PDFs , How to , PDF , PDF forms
737
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 ,
Oct 22, 2024 Oct 22, 2024

Enter the following as a custom calculation script in the field:

function toTitleCase(str) {
  return str.toLowerCase().split(' ').map(function (word) {
    return (word.charAt(0).toUpperCase() + word.slice(1));
  }).join(' ');
}
event.value=toTitleCase(event.value)

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 ,
Oct 22, 2024 Oct 22, 2024

Enter the following as a custom calculation script in the field:

function toTitleCase(str) {
  return str.toLowerCase().split(' ').map(function (word) {
    return (word.charAt(0).toUpperCase() + word.slice(1));
  }).join(' ');
}
event.value=toTitleCase(event.value)
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
Explorer ,
Oct 22, 2024 Oct 22, 2024
LATEST

Thank you so much! This worked beautifully. Many thanks to you. 

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