cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Change text from lower case to upper case

Hi Friends,

I would like to convert the lower case characters that user enter in a text field to upper case. I'm following this discussion but it's not working

Can anyone help me on this?

Thank you

Reply
9 Replies
Not applicable

Re: Change text from lower case to upper case

OK I was trying something and it kinda worked on the form but when I save the changes the characters are converting back to lowercase letters

1. I changed the textbox's Control CSS class

2. In the form settings, I used the CSS code .transformToCapital {text-transform: uppercase;}

3. When I type some characters in the form, they change to uppercase letters. However, when I submit the form, they change back to lowercase.

Any suggestions?

Update:

On the Save button, I tried the fn-ToUpper(Title) method as well

Accept as Solution Reply
Workflow Hero

Re: Change text from lower case to upper case

I use to use short javascript code.

note it changes to uppercase once you leave the control.

NWF$("#" + varControl).on('change', function(){

  this.value=this.value.toUpperCase();

  })

Accept as Solution Reply
Not applicable

Re: Change text from lower case to upper case

Thank you all for your suggestions. So this is what I did, so I'm assuming this might be useful to some of you.

Step 1: Use the CSS class in Control CSS class box and remove the connection for the column

Step 2: Under Form Settings, insert this code in Custom CSS box

Outcome of Step 2 is, at runtime, when characters are typed the conversion automatically happens

Step 3: Insert a Calculated Value and connect it to Title column and use this formula

Note that the Title column in the Formula section should be from the Named Controls tab. In Step 3, I used TitleCase(which changes the first letter of a word to upper case. You can replace it with UpperCase or LowerCase if needed. As the Calculated value can't be hidden, you can change the background color of it or set it to background under an image

Hope this helps. Thank you

Accept as Solution Reply
Workflow Hero

Re: Change text from lower case to upper case

Marian,

If I have a textbox on my form called "ShotRecipient".  How would I format this Javascript function to adjust that text to TitleCase (or Proper) once someone types in the form textbox and leaves the control?  Do you enter this Java in Form Settings?

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Change text from lower case to upper case

there is no OOTB function like toTitleCase() in javascript. you may need to write one yourself.

the solution is typically based on regular expressions, you may find some ideas eg. here Convert string to title case with javascript - Stack Overflow 

or you may search for some already available solutions on github or sourceforge

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Change text from lower case to upper case

Could you please provide some screen shots on how to use this java script? The toUpper runtime function does not seem to work with mobile devices.

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Change text from lower case to upper case

toUpper() runtime function works on nintex mobile

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Change text from lower case to upper case

Hi,

I am trying to test your suggestion but not having much luck.

Am I pasting your code into the Form Settings > Custom CSS or in Advanced > Custom JavaScript Includes ??

Besides that, the reference to that code is it toUpperCase();  or what ?

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Change text from lower case to upper case

you have to put code from above to custom javascript field (not includes!).

and you have to place it into RegisterAfterReady event handler.

you do not need refer/invoke  the code on your own, it attached onchange handler to a respective control which is automatically triggered once the control value changes.

0 Kudos
Accept as Solution Reply