Home ›  Tap Forms Pro ›  Tips & Tricks ›  How to auto capitalize first word of text field only? ▾ 

Category: Tips & Tricks

How to auto capitalize first word of text field only?

This can be done using a field script that formats the input field whenever it changes. The constant textid_ needs to be updated to point to the input field.

I would recommend to hide this field script in order not to clutter the default view.

function capitalizeFirstLetter(string) {
    return string.charAt(0).toUpperCase() + string.slice(1);
}

function Text_Formatter() {
   const text_id = 'fld-xxxx'; // update according to your input field

   let text = record.getFieldValue(text_id);
   text = capitalizeFirstLetter(text.toLowerCase());

   record.setFieldValue(text_id, text, false);
   document.saveAllChanges();
   return text;
}

Text_Formatter();

I noticed that the script wasn’t triggered when I first created it. Closing and reopening the TapForms document fixed it!

Author


Do you like this script? Are you using it? Please consider supporting me by buying me a coffee!

Buy Me Coffee Link

Thanks!


Last modified: Feb 8, 2026 7:33:26 PM


Tap Forms Consulting

Do you need help writing scripts for your Tap Forms Pro database? I'm happy to help you. Contact me to discuss your idea or project.


Web Design Consulting

Do you need help designing your web site or getting Backlight working the way you want? Contact me to discuss your needs.


Buy me a Coffee

If you like what I share here, please consider buying me a coffee or a print. This helps keeping me motivated to continue posting. Thank you!

Buy Me A Coffee