Change first letter entered in a row and in a floating field entry to a capital letter | Community
Skip to main content
Level 5
Jul 8, 2023 12:34 PM UTC
Solved

Change first letter entered in a row and in a floating field entry to a capital letter

Good day,

I'm trying to figure out the best way to do this.  My form has a row that consists of a drop-down list.  When a word is chosen, it automatically enters a word in another row and also in a floating field.  I would like the words in the other row and the floating field to be capitalized.  Is this possible? 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
SivakumarKanoori
SivakumarKanooriAccepted solution
New Participant
Jul 10, 2023 11:46 AM UTC

@islandgirl23 

you can use as below to make first letter of string as Capital letter.


var
str = this.value // dropdown 

var str2 = this.value.charAt(0).toUpperCase() + this.value.slice(1);

console.log(str2);//Dropdown 

 

Thanks

Siva

Thanks,Siva

6 replies

SivakumarKanoori
SivakumarKanooriAccepted solution
New Participant
Jul 10, 2023 11:46 AM UTC

@islandgirl23 

you can use as below to make first letter of string as Capital letter.


var
str = this.value // dropdown 

var str2 = this.value.charAt(0).toUpperCase() + this.value.slice(1);

console.log(str2);//Dropdown 

 

Thanks

Siva

Translate
Thanks,Siva
Level 5
Jul 24, 2023 9:42 AM UTC

It's a Livecycle Designer form.  I entered a script in the row to make it work there but I still need a script for the floating field.

Translate
Vijay_Katoch
New Participant
Jul 10, 2023 5:14 AM UTC

While setting the field value, use script like below:

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

Translate
Level 5
Jul 24, 2023 9:46 AM UTC

I entered a script in the exit event of the row to make it work there ( this.rawValue = util.printx(">?<*",this.rawValue);
 but, I still need a script for the floating field.  Right now, whatever and however it is entered in the row, it enters it the same way in the floating field.  I need just the first letter to be capitalized

Example:  If they enter apple in the row, I would like the floating field to read Apple.

Translate
SivakumarKanoori
New Participant
Jul 10, 2023 4:34 AM UTC

@islandgirl23 : Which form is it ? Is it adaptive form or any other form 

Translate
Thanks,Siva