Username only in lowercase characters and numbers

Hello,
For the registration of my users, I want the username to be only lowercase characters and numbers. (no capital letter, space or special characters)

I was thinking of adding a condition to the registration button, but I can’t find a formula that works. I have explored the possibility of “Find and Replace”, but I do not know the Regex pattern.

Thank you! :wink:

You can convert your value using this parameter:

To add this as a condition/format during the user input you should take a look around some input validation plugin
Also maybe these threads can help:

This regex pattern should help you find non-alphanumeric characters:

[^A-Za-z0-9]

(keep in mind that this is in reverse, so it will return only characters that are not alphanumeric. So use it with the Find and replace)

I think you can execute a do when input value has changed and then format the input’s value to lowercase.

Pretty easy workaround if you ask me. Just make sure to add conditional logic to alert any unwanted characters.

Thanks a lot for your help! it works!

I used conditions (regex “[^ a-z0-9]” + convert value: lowercase) on the validate button of the form, and on a text to inform the user when there is an error in input username .

2 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.