# Xojo2024R1: forcing input to upper case

**URL:** <https://forum.xojo.com/t/xojo2024r1-forcing-input-to-upper-case/80232>\
**Category:** Web\
**Created:** [May 6, 2024, 6:26pm UTC](https://forum.xojo.com/t/xojo2024r1-forcing-input-to-upper-case/80232 "2024-05-06T18:26:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grzegorz\_Greg\_Pasternak](https://forum.xojo.com/letter_avatar_proxy/v4/letter/g/c68b51/32.png) [@Grzegorz\_Greg\_Pasternak](https://forum.xojo.com/u/Grzegorz_Greg_Pasternak)\
**Post date:** [May 6, 2024, 6:26pm UTC](https://forum.xojo.com/t/xojo2024r1-forcing-input-to-upper-case/80232/1 "2024-05-06T18:26:38Z")

</div>

I need to force user input for certain strings to upper case. I can convert the entered value to upper case using Uppercase() function, however, I wonder if there is a way to make it upper case as the user types in the string. Can someone please help me with this problem?

Btw, I wish Xojo could provide option such as “uppercase only” for the text field.

---

<div class="post-metadata">

**Author:** ![AlbertoD](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/dbc845/32.png) [@AlbertoD](https://forum.xojo.com/u/AlbertoD)\
**Post date:** [May 6, 2024, 6:44pm UTC](https://forum.xojo.com/t/xojo2024r1-forcing-input-to-upper-case/80232/2 "2024-05-06T18:44:58Z")

</div>

Try this in the opening event:

```auto
me.Style.Value("text-transform") = "uppercase"

```

> [@Grzegorz\_Greg\_Pasternak](#):
>
> Btw, I wish Xojo could provide option such as “uppercase only” for the text field.

You can create an [Issue](https://issues.xojo.com) asking for that feature.

Edit: this only changes to uppercase what it shows on the field, you still need to handle to uppercase with your code.

---

<div class="post-metadata">

**Author:** ![Kem\_Tekinay](https://forum.xojo.com/user_avatar/forum.xojo.com/kem_tekinay/32/154_2.png) [@Kem\_Tekinay](https://forum.xojo.com/u/Kem_Tekinay)\
**Post date:** [May 6, 2024, 6:48pm UTC](https://forum.xojo.com/t/xojo2024r1-forcing-input-to-upper-case/80232/3 "2024-05-06T18:48:15Z")

</div>

Set the `ValidationMask` property to “\>”.

[https://documentation.xojo.com/api/user\_interface/desktop/desktoptextfield.html#desktoptextfield-format](https://documentation.xojo.com/api/user_interface/desktop/desktoptextfield.html#desktoptextfield-format)

---

<div class="post-metadata">

**Author:** ![AlbertoD](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/dbc845/32.png) [@AlbertoD](https://forum.xojo.com/u/AlbertoD)\
**Post date:** [May 6, 2024, 6:49pm UTC](https://forum.xojo.com/t/xojo2024r1-forcing-input-to-upper-case/80232/4 "2024-05-06T18:49:13Z")

</div>

> [@Kem\_Tekinay](#):
>
> Set the `ValidationMask`

Do we have that for Web?

---

<div class="post-metadata">

**Author:** ![Kem\_Tekinay](https://forum.xojo.com/user_avatar/forum.xojo.com/kem_tekinay/32/154_2.png) [@Kem\_Tekinay](https://forum.xojo.com/u/Kem_Tekinay)\
**Post date:** [May 6, 2024, 6:52pm UTC](https://forum.xojo.com/t/xojo2024r1-forcing-input-to-upper-case/80232/5 "2024-05-06T18:52:10Z")

</div>

D’oh!

I always forget to look at the section. No, I don’t see that for Web. Sorry for the noise.

---

<div class="post-metadata">

**Author:** ![Wayne\_Golding](https://forum.xojo.com/user_avatar/forum.xojo.com/wayne_golding/32/165_2.png) [@Wayne\_Golding](https://forum.xojo.com/u/Wayne_Golding)\
**Post date:** [May 7, 2024, 2:43am UTC](https://forum.xojo.com/t/xojo2024r1-forcing-input-to-upper-case/80232/6 "2024-05-07T02:43:25Z")

</div>

In the openning event of your control add this line

`me.Style.Value("text-transform") = "uppercase"`

---

<div class="post-metadata">

**Author:** ![AlbertoD](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/dbc845/32.png) [@AlbertoD](https://forum.xojo.com/u/AlbertoD)\
**Post date:** [May 7, 2024, 3:22am UTC](https://forum.xojo.com/t/xojo2024r1-forcing-input-to-upper-case/80232/7 "2024-05-07T03:22:44Z")

</div>

> [@Wayne\_Golding](#):
>
> In the openning event

It looks the same as the code I suggested above, no?

---

<div class="post-metadata">

**Author:** ![Wayne\_Golding](https://forum.xojo.com/user_avatar/forum.xojo.com/wayne_golding/32/165_2.png) [@Wayne\_Golding](https://forum.xojo.com/u/Wayne_Golding)\
**Post date:** [May 7, 2024, 3:23am UTC](https://forum.xojo.com/t/xojo2024r1-forcing-input-to-upper-case/80232/8 "2024-05-07T03:23:10Z")

</div>

Should have read the entire thread ☹

---

<div class="post-metadata">

**Author:** ![Grzegorz\_Greg\_Pasternak](https://forum.xojo.com/letter_avatar_proxy/v4/letter/g/c68b51/32.png) [@Grzegorz\_Greg\_Pasternak](https://forum.xojo.com/u/Grzegorz_Greg_Pasternak)\
**Post date:** [May 7, 2024, 3:08pm UTC](https://forum.xojo.com/t/xojo2024r1-forcing-input-to-upper-case/80232/9 "2024-05-07T15:08:35Z")

</div>

Thank you for your help, I have placed it in the code and tested, works well.
