Change first letter entered in a row and in a floating field entry to a capital letter | Community
Skip to main content
Level 5
July 8, 2023
Solved

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

  • July 8, 2023
  • 3 replies
  • 1458 views

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.
Best answer by SivakumarKanoori

@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

3 replies

SivakumarKanoori
Community Advisor
Community Advisor
July 10, 2023

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

Thanks,Siva
Vijay_Katoch
Community Advisor
Community Advisor
July 10, 2023

While setting the field value, use script like below:

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

Level 5
July 24, 2023

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.

SivakumarKanoori
Community Advisor
SivakumarKanooriCommunity AdvisorAccepted solution
Community Advisor
July 10, 2023

@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
Level 5
July 24, 2023

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.