Auto Case formating?

Is there a way to enter text into a WebTextField and have it auto capitalize in the correct location(s)?

Enter ==>> happy valley homes

Change to ==?? Happy Valley Homes

Thanks,
Tim

Just for show or you actually want to change the text?

Just for show is easy, you can use CSS text-transform capitalize. It will show the information on the WebTextField even if typed lowercase, but the text pulled from it will be lowercase.

me.Style.Value("text-transform") = "capitalize"

Note: it will not change “tHis” to “This”, it will show “THis”

What about me.Text = me.Text.TitleCase in TextChanged?

1 Like

I don’t like TextChanged much, even on a local test I get this when I type “this is a test only a test” (round trip, delays, and such):

1 Like

To try, I put Tims code in where I fill a list box with names. That worked perfectly!

Thanks guys
Tim

Make sure it works out on the web too. The low latency of the debug environment can be very misleading in these cases

4 Likes

@ Greg,

Thanks for the warning. After pushing to the cloud and testing, no noticeable latency difference at all.

Tim

1 Like

Interesting. I get this locally (top field with TextChanged), typing ‘this is a test’ on both:
autocapitalize

The bottom field using the CSS in opening event and Tim’s code in FocusLost