Expand my Community achievements bar.

text-transform: uppercase

Avatar

Former Community Member
I want several text fields on my form to default to uppercase, even if the user is in lowercase or types initial caps, or whatever. I've tried using the text-transform style shown in the Subject but can't seem to make it work. Advice? Thanks...
5 Replies

Avatar

Former Community Member
In Designer 7.1, I have used this Javascript on the Exit event of the textfield:



this.rawValue = this.rawValue.toUpperCase();



This will change your text to UpperCase or All Caps.



hd

Avatar

Former Community Member
Does anyone know how to change the format of a text string to Title Case?

On my form the text comes in (binding) as all Upper Case and I need it to appear in Title Case.

I have successfully used

this.rawValue = this.rawValue.toUpperCase(); and

this.rawValue = this.rawValue.toLowerCase();

to convert text to Upper or Lower Case but I have been unsuccessful at converting to Title Case. Does anyone know how to do this?

Avatar

Level 7
You will have to use JavaScript to split the text into words, use the "split(separator)" method to create an array of elements, each element being one word. Convert each element's string value to lower case. You can then use the "substring(indexA, indexB)" to get the first letter of each element string and convert it to upper case and concatenate it to the substring of the element less the first letter.

Avatar

Former Community Member
Thank you for the information---that's way over my head though. Does anyone have a function that could be shared that is known to work in LiveCycle Designer?