Forced lower case input in text field

I have a text field in which the user should input some words, but they should be lower case only. if upper case is used, the text field should autoconvert it to lower case. I do not want to give any warnings if the user used upper case so this should be automatically converted. is this possible?

@kingkai,

Yes, this is possible using the built-in toLowerCase() function. See this .rp file for two methods. One converts the text to lower case on a Text Field widget using the OnTextChange event, so as each character is entered the text value is converted. The other converts to lower case on submit, by clicking the SUBMIT button or pressing the Enter key (because the button is assigned as the text field’s submit button in the Properties panel.

Force Lower Case.rp (53.8 KB)

You can find all sorts of useful variables and functions by clicking the “Insert Variable or Function…” link in the “fx” or “Edit Text” dialog.

1 Like

Just a note for future readers: if you’re going to put anything else on this case, bear in mind that it will trigger twice: once when they input an uppercase character, and again after first trigger changes the text to lowercase. After that everything should be lower case so it won’t infinitely chain.

If you wanted to attach some other action to this and didn’t want it happening twice, you might use a different event like OnKeyUp or something similar.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.