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
- Daniel Leu, info@danielleu.com
Do you like this script? Are you using it? Please consider supporting me by buying me a coffee!
Thanks!
Last modified: Feb 8, 2026 7:33:26 PM
Browse posts:
