Expand my Community achievements bar.

SOLVED

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

Avatar

Level 6

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? 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@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

View solution in original post

6 Replies

Avatar

Community Advisor

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

Thanks,
Siva

Avatar

Community Advisor

While setting the field value, use script like below:

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

Avatar

Level 6

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.

Avatar

Correct answer by
Community Advisor

@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

Avatar

Level 6

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.

Avatar

Level 6

Hello,  I'm still in need of assistance.  My form is a livecycle form.  Where would I enter the scripts you provided?  Please see my reply below.